ASP.NET Web API multiple RoutePrefix -
OpenSource has several path-prefixes why there is not permission to have multiple router profiles () in ASP.NET Web API 2.0. [Rootfix ("API / V1 / {ABC" / unit "]] [RootPrint (" API / V1 / {abc} / {xyz?} / Unit ")] Public class MyApiController: ApiController {[root (" ") ] Public IHttpResult Get () {OK OK ("Hello World"); }}
You can add a route to the verb method, as well as routerpixes [RoutePrefix ("API / V1 / {ABC} / Entity")) Public category MyApiController: ApiController {[root ("") "" "
Example: ] [Route ("~ / api / v1 / {abc} / {xyz?} / Unit")] Get Public IHttpResult () {OK OK ("Hello World");}}
Note the line: [Route ("~ / API / V1 / {ABC} / {xyz?} / Unit")]
Comments
Post a Comment