CHAPTER 18

image

Filters

Filters inject extra logic into MVC Framework request processing. They provide a simple and elegant way to implement cross-cutting concerns. This term 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 pattern. Classic examples of cross-cutting concerns are logging, authorization, and caching. In this chapter, I show you the different categories of filters that the MVC Framework supports, how to create and use custom filters, and how to control their execution. Table 18-1 provides the summary for this chapter.

Get Pro ASP.NET MVC 5, Fifth 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.