Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Search for route in RouteCollection

$
0
0

Is there a way to find a specific route and his values / datatokens in RouteCollection by a value.

I get the list with all routes with the code below. In the Collection is a non public member _namedRoutes and _Routes. In those two are the routes with the datatokens and values. But I don't know how to reach them and search for a specific route

RouteCollection Collection = ViewContext.RouteData.Routers.OfType<RouteCollection>().FirstOrDefault() 

Can someone help with this? Thanks in advance

P.S. I'm doing this in razor syntax


Viewing all articles
Browse latest Browse all 9386

Trending Articles