Please enable JavaScript.
Coggle requires JavaScript to display documents.
Routing - Coggle Diagram
Routing
There are two types of routing 1.Convention-Based Routing, 2. Attribute-Based Routing.
Attribute-Based Routing in ASP.NET Core MVC is a powerful approach to defining URL routes by using Route Attributes directly on our controller actions or controllers themselves. This is defined in controller level or action method level. This will override the conventional approach
-
conventional-Based Routing in ASP.NET Core MVC is a routing mechanism that relies on a set of conventions and default patterns to map the incoming URLs (HTTP Requests) to controller actions. This is defined in program.cs file in .NET 6 afterwards
This we way we can define a route parameter constraint pattern: “{controller}/{action}/{id:int}” but routing order is important in conventional approach.
-
If both Routings are present, then .NET Core will override the convention routes by Attribute-Based. This is because .NET Core gives preference to attribute routes.
The Routing in the ASP.NET Core MVC Web Application is a mechanism in which it will inspect the incoming HTTP Requests (i.e., URLs) and then map that HTTP request to the controller’s action method
-
-
-