Skip to Main Content
Expert ASP.NET Web API 2 for MVC Developers
book

Expert ASP.NET Web API 2 for MVC Developers

by Adam Freeman
August 2014
Intermediate to advanced content levelIntermediate to advanced
688 pages
18h 5m
English
Apress
Content preview from Expert ASP.NET Web API 2 for MVC Developers

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Web API 2: Building a REST Service from Start to Finish

ASP.NET Web API 2: Building a REST Service from Start to Finish

Jamie Kurtz, Brian Wortman
Practical ASP.NET Web API

Practical ASP.NET Web API

Badrinarayanan Lakshmiraghavan
Pro ASP.NET Web API: HTTP Web Services in ASP.NET

Pro ASP.NET Web API: HTTP Web Services in ASP.NET

Tugberk Ugurlu, Alexander Zeitler, Ali Kheyrollahi

Publisher Resources

ISBN: 9781484200858Purchase book