ExecuteCore () vs OnActionExecuting (ActionExecutingContext filterContext)?

Just curious, they are similar. What are the differences between ExecuteCore () and OnActionExecuting (ActionExecutingContext filterContext)?

In what situations would it be more beneficial to use others?

+5
source share
2 answers

In fact, these are just different points in the MVC execution pipeline.

  • ExecuteCore is called by MvcHandler after the controller instance itself. At this point, MVC does not even know how the controller will refer to its action. You can override the standard ExecuteCore controller to configure its overall execution process a bit.

  • OnActionExecuting - . ControllerActionInvoker. MVC , , , ( ) (OnActionExecuting, OnActionExecuted, OnResultExecuting ..).

, , , .

  • ExecuteCore ( ).
  • , , ( AOP- / ).
+10

ExecuteCore , OnActionExecuting . , , , :

filterContext.Result = ...
+5

All Articles