Hi all,
I need help.
How to get inserted Id on "OnResultExecuted" event
My code is this.
public override void OnResultExecuted(ResultExecutedContext context)
{
if (!(context.ActionDescriptor is ControllerActionDescriptor actionDescriptor)) return;
if (actionDescriptor.ControllerTypeInfo == typeof([controllerName]) &&
(actionDescriptor.ActionName == "Create" || actionDescriptor.ActionName == "Edit") &&
context.HttpContext.Request.Method == "POST")
{
var data = context.HttpContext.Request.Form["Id"];
var data1 = context.HttpContext.Request.Form["Text1"];
var data2 = context.HttpContext.Request.Form["Text2"];
return;
}
else
{
return;
}
}
At the time of edit I get the id but at the time of create I can't get the Id field.
Is there any way to get the Id.