Filters

Filters in ASP.NET Core MVC are the places where we can run the code before or after the action execution in the request processing pipeline. Filters run within the MVC action invocation pipeline, also known as filter pipeline. This pipeline comes into View after the framework chooses the action to be executed.

The following list view code map diagram illustrates the actors involved in filters:

On the right, we have attributes defined, which are abstract classes. On the left, there are abstractions and context classes. The filters execute at different stages in the action execution pipeline, based on the type of filter, which can be: ...

Get .NET Core 2.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.