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 22

image

Controllers and Actions

In this chapter, I continue describing the Web API dispatch process and focus on controllers and action methods. I explain how controllers work in Web API and describe the dispatch process implemented by the default controller class, ApiController. Along the way, I show you how to resolve a common routing problem, explain how requests are mapped to action methods in RESTful Web API controllers, and show you how to customize request dispatching. Table 22-1 summarizes this chapter.

Table 22-1. Chapter Summary

Problem

Solution

Listing

Create a controller.

Define a class that implements the IHttpController interface ...

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