I'm working on a project in 2017 Visual Studio CE utilizing .Net Core 2.0. I created an API directory for my Web API Controllers, and a Controllers directory for my standard MVC controllers.
I have a StoresController in each directory. The one in the API directory specifies the Route attribute as [Route("api/[controller]")]. The one in the Controllers directory does not have a Route attribute; it relies on the default routes set up in Startup.cs.
I created the following Delete link on my Edit view using the built-in tag helpers: <a asp-action="Delete" asp-controller="Stores" asp-route-id="@Model.Id" class="btn btn-danger">Delete</a>
For some reason this links to /api/stores/{id} instead of /stores/delete/{id}. Is there a way to configure the tag helpers to use the default MVC routes instead of the API routes? Or do I need to rename classes/action names?
Update: The Route attribute has an Order parameter that is supposed to affect the priority of the route when resolving requests. Changing this value did not affect the output of the tag helper.