mina shaker

mina shaker

  • 1.6k
  • 125
  • 6.7k

what are convintioal routing order in asp.net core web application

Sep 3 2024 6:33 PM

i was reading about the Convintional routing order in the docs but i read this sentence , can any one give me an explanation to the below sentence with code :

Conventional routing only matches a combination of action and controller that are defined by the app. This is intended to simplify cases where conventional routes overlap. Adding routes using MapControllerRoute, MapDefaultControllerRoute, and MapAreaControllerRoute automatically assign an order value to their endpoints based on the order they are invoked. Matches from a route that appears earlier have a higher priority. Conventional routing is order-dependent. In general, routes with areas should be placed earlier as they're more specific than routes without an area. Dedicated conventional routes with catch-all route parameters like {*article} can make a route too greedy, meaning that it matches URLs that you intended to be matched by other routes. Put the greedy routes later in the route table to prevent greedy matches.


Answers (2)