I am writing custom filter
in my Web API
and there I want to modify the result of ActionExecutedContext
inside the OnActionExecuted
method.
I got the result type as OkObjectResult
as the action method
is returning IActionResult
.
public void OnActionExecuted(ActionExecutedContext context)
{
var myResult = context.Result;
//Type of myResult is OkObjectResult
}
So here how can I convert this OkObjectResult
to my model Object
, So that I can use the properties
and manipulate the values.
Appreciated any suggestion.