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 21

image

URL Routing: Part II

In this chapter, I continue describing the Web API URL routing feature, focusing on direct routes, which are defined by applying attributes to controllers and action methods. I also show you different ways in which you can customize the routing process. Table 21-1 summarizes this chapter.

Table 21-1. Chapter Summary

Problem

Solution

Listing

Define a direct route.

Apply the Route attribute to one or more action methods or to the controller itself.

1, 2, 10, 11

Define a common prefix that will be used in all of the direct routes in a controller.

Apply the RoutePrefix attribute to the controller class.

3

Define an optional ...

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