-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IRouter.GetVirtualPath alternative in EndpointRouting #23041
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
The following issue will replace this: |
@alienwareone Did you find a solution/workaround for this issue? I'm also moving from IRouter to endpoint routing and this feels like a deal breaker. @rynowak maybe you have some workaround or is it back to IRouter for us trying to convert to endpoint routing? |
@marcuslindblom I migrated to:
|
@alienwareone I tried using the This transformer: public string TransformOutbound(object? value)
{
return "hello-from-transformer";
} Using this tag helper: <a asp-controller="home" asp-action="index" asp-route-id="66eb5dbc-e73b-4d8f-add5-d245ebf14683">Hello, world</a> Generates this link: Also, instead of using Constraints I use Conventions to add my transformer. |
Thanks for contacting us. We're moving this issue to the |
For most use cases, it is possible to override the UrlHelperFactory and implement your logic there: https://stackoverflow.com/a/71871803/4101909 However, this is far from ideal, and is sync-only. |
Just for the record: no. It's not a suitable alternative. DynamicRouteValueTransformer requires that you both have the dynamic route as well as the target route it should transform to, available and registered. The solution to that particular problem is to not use the tools MS gives you, but instead cook up your own That's basically how you do what DynamicRouteValueTransformer does; except correctly. URL generation requires registering a custom In both cases, |
Thanks for contacting us. We're moving this issue to the |
Based on this topic:
#18883
The "IRouter.RouteAsync" alternative is "DynamicRouteValueTransformer.TransformAsync".
What is the "VirtualPathData GetVirtualPath(VirtualPathContext context)" alternative for complex url generation?
For example:
In my view:
Url.RouteUrl("ProductList", new { context = Model.ProductListRouteContext });
The text was updated successfully, but these errors were encountered: