According to this documentation for ASP.NET filters, filters work in the following order:
- Authorization Filters
- Action filters
- Response filters
- Exception filters
Inside each type of filter there is an Order filter, which determines the execution order.
It makes sense so far ... but then it gets weird.
There is another way of ordering in each type and order of the filter, which is presented as an enumeration of the following values:
public enum FilterScope { First = 0, Global = 10, Controller = 20, Action = 30, Last = 100, }
What does a global controller and an action have in order to execute an action filter?
For instance:
If I have two Action Filters, both with execution order 1 and FilterScope Controller and Action respectively.
Except for ordering one opposite the other, what does Controller and Action to do with something?
Further Bizarreness
Accordingly, FilterScope provides third-level ordering for filters. How is Controller , Global or Action order for a filter that is in no way limited to be used only on Controller , Action and is not necessarily applied globally? He does not describe the order.
In addition, if it provides filtering at the third level, why is it limited to only 5 parameters?
source share