How can I add the ControllerActionDescriptor into RouteEndpoint.Metadata

Faiven Chan 1 Reputation point
2021-09-29T03:47:24.187+00:00
  1. I am building a role-based access control asp.net core web api system.
  2. my permissions base on controller and action
  3. I need to know which controller and action the incoming request is routed to in my CustomAuthorizationHandler
  4. How can I add the ControllerActionDescriptor into RouteEndpoint.Metadata? It's not in the Metadata by default

136090-20210929114359.png

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.