-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutaffected-very-fewThis issue impacts very few customersThis issue impacts very few customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-routingseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Description
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:
public override VirtualPathData GetVirtualPath(VirtualPathContext context)
{
var routeContext = context["context"] as new ProductListRouteContext();
var pathSegements = new List<string>();
if (context?.Category?.PageName != null)
{
pathSegments.Add(context.Category.PageName);
}
// Add other pathSegements based on the context/filters...
return new new VirtualPathData(this, string.Join("/", pathSegments));
}
In my view:
Url.RouteUrl("ProductList", new { context = Model.ProductListRouteContext });
NiclasLindqvist, marcuslindblom and aloksharma1
Metadata
Metadata
Assignees
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutaffected-very-fewThis issue impacts very few customersThis issue impacts very few customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-routingseverity-majorThis label is used by an internal toolThis label is used by an internal tool