Sunday, 15 February 2015

Attribute Routing in MVC



Attribute Routing

In my previous post we saw we register route in RouteConfig. In some applications there can be many combinations for routes. Registering all the combinations by RegisterRoutes on Application_Start event becomes a bit overwhelming to handle. For such kind of scenarios we can take advantage of Attribute Routing which is a very handy mechanism. Attribute Routing is all about defining routes directly on controller actions by using attributes. There is a very good article written by one of the techie Shailendra Chauhan regarding Attribute Routing.
http://www.dotnet-tricks.com/Tutorial/mvc/4PK4010514-Understanding-Attribute-Routing-in-ASP.NET-MVC.html
You can also go through one more article i came across which i found interesting.
http://sampathloku.blogspot.in/2013/11/attribute-routing-with-aspnet-mvc-5.html?showComment=1424026336506#c2639721383465155597 

No comments:

Post a Comment