Reputation: 43
In dotnet core 6 service (class library) I am accessing HttpContextAccessor.HttpContext.GetRouteData()
but it says it does not contains definition for GetRouteData
.
Any help on this.
Thanks.
Upvotes: 2
Views: 454
Reputation: 529
GetRouteData()
is an extension method in namespace Microsoft.AspNetCore.Routing
.
You have to add using Microsoft.AspNetCore.Routing;
Upvotes: 3