There are four types of Filters available in MVC.
a. Authorization filter
b. Action filter
c. Result filter
d. Exception filter
A new filter called Authentication filter was introduced in MVC 6.
Authorization filter:
1. Interface to be implemented - IAuthorizationFilter
2. Usage - IAuthorizationFilter validates authorization about whether to execute an action method or not and also it validates the properties of the request
3. Methods - OnAuthorization
Action filter:
1. Interface to be implemented - IActionFilter
2. Usage - IActionFilter Can perform additional operations before and after execution of action methods
3. Methods - OnActionExecuting, OnActionExecuted
Result filter:
1. Interface to be implemented - IResultFilter
2. Usage - IResultFilter Can perform additional operations before and after execution of view results
3. Methods - OnResultExecuting, OnResultExecuted
Exception filter:
1. Interface to be implemented - IExceptionFilter
2. Use - Exception filters will get executed if there is an unhandled exception thrown during the execution of the ASP.NET MVC pipeline. Exception filters can be used for tasks such as logging or displaying an error page
3. Methods - OnException