© Adam Freeman 2016

ADAM FREEMAN, Pro ASP.NET Core MVC , 10.1007/978-1-4842-0397-2_19

19. Filters

Adam Freeman

(1)Milton Keynes MK6 3PA, UK

Filters inject extra logic into MVC request processing. They provide a simple and elegant way to implement cross-cutting concerns—a term that refers to functionality that is used all over an application and doesn’t fit neatly into any one place, where it would break the separation of concerns. Classic examples of cross-cutting concerns are logging, authorization, and caching. In this chapter, I show you the different categories of filters that MVC supports, how to create and use custom filters, and how to control their execution. Table 19-1 puts filters in context.

Table 19-1. Putting Filters in Context

Question ...

Get Pro ASP.NET Core MVC, Sixth Edition 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.