In AspNetCore, mit einem FilterContext, suche ich nach einer Route Vorlage, z. {controller}/{action}/{id?}
Kann ich das RouteTemplate von AspNetCore FilterContext erhalten?
In Microsoft.AspNet.WebApi ich die Strecke Vorlage von bekommen konnte: HttpControllerContext.RouteData.Route.RouteTemplate
In System.Web.Mvc Ich konnte dies aus: ControllerContext.RouteData.Route as RouteBase
In AspNetCore gibt es: FilterContext.ActionDescriptor.AttributeRouteInfo.Template
Nicht alle Routen sind jedoch Attributrouten.
Basierend auf Inspektion, wenn das Attribut nicht verfügbar ist, Standardrouten und/oder zugeordneten Routen aus montiert werden: FilterContext.RouteData.Routers.OfType<Microsoft.AspNetCore.Routing.RouteBase>().First()
aber ich bin für einen dokumentiert oder einfach bessere Lösung suchen.