CHAPTER 23

image

Filters Part I

I touched on filters in Chapter 20 so that I could describe the dispatch process that the ApiController class implements. In this chapter, I describe how filters work in depth and demonstrate how they can be used to add cross-cutting concerns to a Web API application. Table 23-1 summarizes this chapter.

Table 23-1. Chapter Summary

Problem

Solution

Listing

Add logic to the dispatch pipeline.

Define an action filter by defining an attribute that implements the IActionFilter interface. Apply the attribute to the action method or controller where the logic is required.

1–2

Create an action method without having to manage continuation ...

Get Expert ASP.NET Web API 2 for MVC Developers 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.