title: Read Controller and Action name in middleware .Net Core
body: <p>I am writing a middleware class within my project in order to log the request data into our database.</p>
  
  <p>I do not see any easy way to get the controller name and action ? 
  Any chance to do this easily in core? </p>
  
  <p>I have something like this:</p>
  
  <pre><code>public class RequestResponseLoggingMiddleware
  {
      private readonly RequestDelegate _next;
  
      public RequestResponseLoggingMiddleware(RequestDelegate next)
      {
          _next = next;            
      }
  
      public async Task Invoke(HttpContext context)
      {        
          //handle the request
          //something like: context.GetRouteData();
  
          await _next(context);                 
  
          //handle the response
      }       
  }
  </code></pre>