Amita Palkar - Junnarkar
Which route configuration override other. Route.config vs Route attribute?
By Amita Palkar - Junnarkar in .NET on Mar 23 2018
  • Gajanan Chavhan
    Apr, 2018 10

    It is based on how you configure it in RouteConfig.cs. if you write routes.MapMvcAttributeRoutes(); before conventional routes it will give preference to attribute based routing. and if you place conventional routing before routes.MapMvcAttributeRoutes() it will give preference to conventional routing

    • 1
  • Jignesh Kumar
    Jun, 2018 18

    MVC 5 introduce new feature of attribute routing which is allows developer to write their routing more flexible way using action method decorator pattern. But to enable attribute routing you have to enable attribute routing in Rout.Config file routes.MapMvcAttributeRoutes() before conventional routes. You write this setting in Rout.Config file then it will give preference to attribute Routes.

    • 0

Most Popular Job Functions