I used to have a NET Web API (4.6.2) application that had some ambiguous routes. Something like this:
[RoutePrefix(RoutePrefix)]
public class TestController : ApiController
{
public const string RoutePrefix = "test";
[HttpGet, Route("")]
public IHttpActionResult GetAll(Guid uid, [FromUri]int limit, [FromUri]int offset)
{
// Logic Here.
}
[HttpGet, Route]
public async Task<IHttpActionResult> Test([FromUri]Guid id, [FromUri]int? limit = null, [FromUri]int? offset = null)
{
// Logic Here.
}
}
All of this was working on the past because I had this setting on my Startup:
config.MapHttpAttributeRoutes();
The problem is that I'm converting this API to a NET Core MVC API and the MapHttpAttributeRoutes setting is not available anymore. This means that right now I'm having some ambiguity issues on some of the actions (like the one mentioned above).
I know that one way around (And I want to do that in the future) is to have a specific route for every action. At this point and based on the usage of this API I cannot change all the routes. With all this, I was wondering if someone found a way to handle this situation without changing the routes?
Thank you guys.