RedirectToRouteResult doesn't use RouteName property when calculating destination URL #2545
Description
The Controller.RedirectToRoute()
method creates a RedirectToRouteResult
instance and passes in the routeName
and routeValues
parameters to it, which are assigned to the RedirectToRouteResult.RouteName
and RedirectToRouteResult.RouteValues
properties, respectively.
However, on line 48 in the RedirectToRouteResult.ExecuteResult()
method, the RouteName
property is never used to calculate the destination URL; it is essentially ignored.
I would have expected that Controller.RedirectToRoute()
method to consider my provided routeName
when calculating the destination URL.
The workaround for now, is pretty simple: just calculate my own destination URL using the controller's UrlHelper, but since Controller.RedirectToRoute()
didn't behave as I had expected it to, I'm filing an issue for it.