In Asp.Net Core, How it's possible to get the current area name in the OnActionExecuting method of action filter?
I tried the below statement, but it's returning me null at all times.
var area = context.RouteData.DataTokens["area"];
In Asp.Net Core, How it's possible to get the current area name in the OnActionExecuting method of action filter?
I tried the below statement, but it's returning me null at all times.
var area = context.RouteData.DataTokens["area"];
Got the solution and working with Asp.Net core 5.0 also:
ViewContext?.ActionDescriptor?.RouteValues["area"]