Let's see, everyone, ActionExecutingContext object A total of 3 references. Below I come one by one parse:
Call base. OnActionExecuting (Filtercontext) After this, will not perform the subsequent actionfilter, if you are sure only one, or do not want to follow up, then you can not call the statement
FilterContext.ActionDescriptor.ActionName the action name executed by the context
Filtercontext.result is the custom result returned after executing the context action.
And then we'll take a look at this actionexecutingcontext class, see
Here's a clearer explanation of what the ActionExecutingContext class can do for you. Of course, I would like to say that this class is generally used to filter the custom filter, for the controller itself inherits the ActionFilterAttribute base class, so it can be rewritten onactionexecuting the following describes the class-related methods
|
Method |
Parameters |
Describe |
|
OnActionExecuting |
ActionExecutingContext |
Execute before the behavior method executes |
|
onactionexecuted |
ActionExecutedContext |
Executes after the behavior method executes |
|
Onresultexecuting |
ResultExecutingContext |
Executes before the behavior method returns |
|
onresultexecuted |
ResultExecutedContext |
Executes after the behavior method returns |
The four method execution order is onactionexecuting-->onactionexecuted-->onresultexecuting-->onresultexecuted
Action context for MVC: ActionExecutingContext