Attribute-Based Routing
Until now, we have used convention-based routing. In convention-based routing, we define the routing templates (which are just parameterized strings) in a centralized place that is applicable to all the available controllers. The problem with convention–based routing is that, if we want to define different URL patterns for different controllers, we need to define a custom URL pattern that is common to all the controllers. Also, convention-based routing sets our general routing template. It is more flexible; changing it programmatically at runtime is possible. This makes things difficult.
There is another option for configuring the attribute-based engine routing. In attribute-based routing, instead of configuring all the routing in a centralized location, the configuration will happen at the controller level. We can customize and override our conventions. Attribute-based routing is more static and determined at runtime.