In fact, if we are able to set the default route in properties-> web-> starting location. what route tables, user routes, RegisterRoutes in global.asax need. I tried this way
at first it seems
routes.MapHttpRoute( name: "Default Api", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } );
Now I want to make localhost:xxxx/api/products as the default route for my web api, then
routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/Products/{id}", defaults: new { controller = "Products", id = RouteParameter.Optional } );
But the results are futile.
Karthik bammidi
source share