-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Async IRouteConstraint - IRouter.GetVirtualPath alternative in EndpointRouting? #18883
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
Comments
Route constraints have to run during URL generation which is synchronous, so it's not straightforward to add something like this. If you want to achieve the same effect, you could add a |
Thanks for your answer! I guess I'll go with "DynamicRouteValueTransformer" to replace my custom IRouter implementation. What is the "VirtualPathData GetVirtualPath(VirtualPathContext context)" alternative for complex url generation? For example:
In my view:
|
We don't have one right now. Depending on your scenario you might want to stick with old routing in 3.X. If you want to provide more info about what you need to accomplish, I can make sure to include it in 5.0 plans. |
Right now there seems no way to generate an Url based on a DynamicRouteValueTransformer-Route.
|
@alienwareone I think @rynowak is trying to ask for a use case so that he can understand if we need to add a feature here or if he can recommend an alternative way of achieving the same thing. |
Here is the relevant code for my use case. Just ask me if anything is unclear. Thanks.
|
Thanks for contacting us. Given that this is possible to achieve using a custom policy we do not plan to do anything here. |
It's not about policy. It's about "IRouter.GetVirtualPath alternative in EndpointRouting". I made a separate "Feature request" to make this more clear. |
There should be an async version of Microsoft.AspNetCore.Routing.IRouteConstraint.
The text was updated successfully, but these errors were encountered: