官术网_书友最值得收藏!

Routing

This chapter talks about routing, that is, the process by which ASP.NET Core translates a user request into an MVC controller and action. This can be a complex process because subtle changes in a request can lead to different endpoints (controller/action pairs) being called. Several aspects need to be taken into account: the protocol (HTTP or HTTPS), whether the user issuing the request is authenticated or not, the HTTP verbs, the path of the request, the query string, and the actual types of the path and query string parameter values.

Routing also defines what happens when a route is not matched, that is, the catch-all route, and it can be used for complex situations where we need to define custom route constraints.

ASP.NET Core offers different ways by which we can configure routing, which can be divided into convention-based and explicit configuration.

By the end of this chapter, you will be able to define routing tables and apply routing configuration in all of the different ways made available by ASP.NET Core for MVC applications.

The objectives of this chapter are listed here:

  • Understanding endpoint routing
  • Configuring routing
  • Understanding routing tables
  • Using route templates
  • Matching route parameters
  • Using dynamic routing
  • Learning route selection through attributes
  • Forcing host selection from attributes
  • Setting route defaults
  • Routing to inline handlers
  • Applying route constraints
  • Using route data tokens
  • Routing to areas
  • Using attributes for routing
  • Using routes for error handling
主站蜘蛛池模板: 沙坪坝区| 进贤县| 沙湾县| 福建省| 梅河口市| 景谷| 武穴市| 石景山区| 江永县| 台北县| 株洲县| 甘南县| 利川市| 广德县| 紫云| 凉山| 丹江口市| 东至县| 高台县| 东莞市| 南靖县| 吉安县| 龙口市| 富裕县| 治县。| 阿克| 西昌市| 赣州市| 临清市| 迁西县| 新巴尔虎左旗| 六安市| 亳州市| 平潭县| 土默特右旗| 太仆寺旗| 临城县| 疏附县| 孟津县| 交城县| 阆中市|