Filters run within the MVC context; it runs along with the MVC Action Invocation pipeline, which is also known as the Filter pipeline.
Filter pipeline gets executed in the following way:
- Starts only when MVC middleware takes over. This is the reason filters are not part of other middleware.
- Authorization filters are the first to run; if it's not authorized, then it short-circuits the pipeline immediately.
- Resource filters come into action for authorized request. They can run at the very beginning of the request as well as at the end, before leaving the MVC pipeline.
- Actions are an essential part of MVC. The Action filters run just before or after the actions of controllers get executed. They have access to model-bound parameters. ...