webapi - a most terrible thing.
-
Is there any way to overwrite the routes in webapi project?
I want to override all of the wonderful methods in the Global.asax.csWish M$ had paid more attention to someone developing a pure webapi project.
AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles);
-
@Nagesh said in webapi - a most terrible thing.:
Is there any way to overwrite the routes in webapi project?
Yes? When I get into work maybe I'll look up how we did it...
-
@Tsaukpaetra said in webapi - a most terrible thing.:
@Nagesh said in webapi - a most terrible thing.:
Is there any way to overwrite the routes in webapi project?
Yes? When I get into work maybe I'll look up how we did it...
Thanks! I hope you have plunged into the code and removed its guts and replaced them. Those are the things I like to do a lot.
Confusion over Convention over configuration!
-
@Nagesh said in webapi - a most terrible thing.:
Wish M$ had paid more attention to someone developing a pure webapi project.
From what I've heard, they made it harder to do pure WebAPI in .NET Core as it's more tightly coupled with MVC now.
I haven't used WebAPI in .NET Core, so I can't verify the accuracy of this.
-
@Nagesh said in webapi - a most terrible thing.:
@Tsaukpaetra said in webapi - a most terrible thing.:
@Nagesh said in webapi - a most terrible thing.:
Is there any way to overwrite the routes in webapi project?
Yes? When I get into work maybe I'll look up how we did it...
Thanks! I hope you have plunged into the code and removed its guts and replaced them. Those are the things I like to do a lot.
Confusion over Convention over configuration!Ah, no. There's a "special" controller that overrides the base path:
and each method is decorated with what route is expected: