How to setup Routes in URL Routing?
How to setup Routes
There are two different ways by which we can set up routes.
1. Convention-based routing
2. Attribute routing
Convention-based routing
- The Convention-based Routing creates routes based on a series of conventions, defined in the ASP.NET Core Startup. cs file.
Attribute routing
- Creates routes based on attributes placed on controller actions.
- The two routing systems can co-exist in the same system.
- The Convention-based Routes are configured in the Configure method of the Startup class. The Routing is handled by the Router Middleware. ASP.NET MVC adds the routing Middleware to the Middleware pipeline when using the app.UseMVC or app. UseMvcWith DefaultRoute.
Comments
Post a Comment