FilterScope Enumeration
Defines values that specify the order in which ASP.NET MVC filters run within the same filter type and filter order.
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Syntax
'Declaration
Public Enumeration FilterScope
'Usage
Dim instance As FilterScope
public enum FilterScope
public enum class FilterScope
public enum FilterScope
Members
Member name | Description | |
---|---|---|
First | Specifies first. | |
Global | Specifies an order before Controller and after First. | |
Controller | Specifies an order before Action and after Global. | |
Action | Specifies an order before Last and after Controller. | |
Last | Specifies last. |
Remarks
The ASP.NET MVC framework supports the following types of filters:
Authorization filters, which implement the IAuthorizationFilter interface.
Action filters, which implement the IActionFilter interface.
Response filters, which implement the IResultFilter interface.
Exception filters, which implement the IExceptionFilter interface.
Filters run in the order listed — for example, authorization filters run first and exception filters run last. Within each filter type, the Order value specifies the run order. Within each filter type and order, the Scope value specifies the order for filters. This enumeration defines the following filter scope values (in the order in which they run):
First
Global
Controller
Action
Last
For example, an action filter that has the Order property set to zero and filter scope set to First runs before an action filter that has the Order property set to zero and filter scope set to Action.
The execution order of filters that have the same type, order and scope is undefined.