I have this code in ASP.NET MVC 3 and now, I'm converting it to ASP.NET Core MVC.
In the class file, I'm reading RouteData
values as shown here:
public class Utilities
{
public Utilities()
{
_urlWord = Convert.ToString(HttpContext.Current.Request.RequestContext.RouteData.Values["url"]);
}
}
How to convert this into ASP.NET Core MVC code? How to read the RouteData
values in ASP.NET Core MVC?