title: How to get a list of all routes in ASP.NET Core?
body: <p>In ASP.NET Core, is there a way to see a list of all the routes defined in Startup? We are using the <code>MapRoute</code> extension method of <code>IRouteBuilder</code> to define the routes. </p>
  
  <p>We are migrating an older project WebAPI project. There we could use <code>GlobalConfiguration.Configuration.Routes</code> to get all the routes. </p>
  
  <p>More specifically, we are doing this within an action filter. </p>
  
  <pre><code>public class MyFilter : ActionFilterAttribute
  {      
      public override void OnActionExecuting(ActionExecutingContext actionContext)
      {
          base.OnActionExecuting(actionContext);
  
          // This no longer works
          // var allRoutes = GlobalConfiguration.Configuration.Routes;
  
          // var allRoutes = ???
      }
  }
  </code></pre>