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

Accessing RouteData from Middleware

$
0
0

Anyone have any idea how to access the current route from middleware? There is no simple RouteTable like in ASP.NET5 to access.

The RouteData is what I need access to. In previous betas I was able to access it like so but that seems to be gone now.

var contextAccessor = context.RequestServices.GetRequiredService<IScopedInstance<ActionContext>>();
var values = contextAccessor.Value.RouteData.Values;




Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>