Accessing RouteData in an ASP.NET Core Controller Constructor

added by DotNetKicks
5/16/2019 1:56:27 PM

2 Kicks, 148 Views

Ran into a difficulty trying to get access to RouteData() generically outside of Controller code in ASP.NET Core. Specifically I needed to get at route data to pull out a tenant ID required to set up a DbContext with the right connection string to connect to.