O'Reilly logo

Expert ASP.NET Web API 2 for MVC Developers by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required