In ASP.NET Core, filters allow the running of code before or after the execution of a particular resource in the pipeline. It can be configured on method, controller, or globally. They run within the MVC Action Invocation pipeline known as Filter pipeline when a particular action is selected by MVC based on the routing:
ASP.NET Core provides various filters, such as Authorization filters to decide whether the user accessing the resource is authorized or not. Resource filters are used to filter incoming requests in the pipeline and are mostly used for caching. Exception filters are used to apply policies that run ...