Skip to content

Commit

Permalink
Update AspNetCoreApiDescriptionModelProvider.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
realLiangshiwei committed Dec 29, 2021
1 parent de6dfb3 commit 3822c3c
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,7 @@ private static string GetRootPath(
return setting.RootPath;
}

var areaAttr = controllerType.GetCustomAttributes().OfType<AreaAttribute>().FirstOrDefault();
if (areaAttr != null)
{
return areaAttr.RouteValue;
}

areaAttr = actionDescriptor.EndpointMetadata.OfType<AreaAttribute>().FirstOrDefault();
var areaAttr = controllerType.GetCustomAttributes().OfType<AreaAttribute>().FirstOrDefault() ?? actionDescriptor.EndpointMetadata.OfType<AreaAttribute>().FirstOrDefault();
if (areaAttr != null)
{
return areaAttr.RouteValue;
Expand Down

0 comments on commit 3822c3c

Please sign in to comment.