Saqib
Saqib

Reputation: 43

HttpContextAccessor.HttpContext.GetRouteData not have definition

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

Answers (1)

emilsteen
emilsteen

Reputation: 529

GetRouteData() is an extension method in namespace Microsoft.AspNetCore.Routing.

You have to add using Microsoft.AspNetCore.Routing;

Upvotes: 3

Related Questions