Closed
Description
- There seems to be a big change with routing when endpoint routing is enabled in 2.2 and 3.0.
- What I am noticing is route params aren't passing through when creating action links anymore
HomeController
[Route("profile/{userId}")]
public IActionResult Profile()
{
return View();
}
[Route("purchases/{userId}")]
public IActionResult Purchases()
{
return View();
}
Profile.cshtml
@Html.ActionLink("Purchases Link", "Purchases", "Home")
-- 2.2 with options.EnableEndpointRouting = false;
Direct to https://localhost:44353/profile/1234
Expected ActionLink Url: https://localhost:44353/purchases/1234
Actual ActionLink Url: https://localhost:44353/purchases/1234
-- 2.2 with options.EnableEndpointRouting = true;
Direct to https://localhost:44353/profile/1234
Expected ActionLink Url: https://localhost:44353/purchases/1234
Actual ActionLink Url: https://localhost:44353/profile/1234
-- 3.0
Direct to https://localhost:44353/profile/1234
Expected ActionLink Url: https://localhost:44353/purchases/1234
Actual ActionLink Url: https://localhost:44353/Home/Purchases