C#C
C#16mo ago
Sun

Get route information on controller

In my response model, I have stuff like method and path of the route. Is there any classes or methods I can call to inject that into the function?

Example
class FooController : ControllerBase {
  [HttpGet] // I know it's a get here, but not during runtime
  async Task<ActionResult<CoolioResponse>> Bar(
    // What to inject here? HttpContext?
  ) {
    
  }
}
Was this page helpful?