DEV Community

loading...

Discussion on: Using cancellation tokens on ASP.NET Core MVC actions

Collapse
joaofbantunes profile image
João Antunes Author

Hi,

I'm not really sure of what may cause this (but I have a vague idea of such problem in the past), so I'll drop a couple of ideas that may be able to help you investigate.

  • Depending on if it's a GET, POST, etc, try to use an attribute to indicate from where the parameter comes from, e.g.: [FromRoute], [FromQuery], [FromBody].
  • Instead of the first idea, you could instead use the [ApiController] attribute, which will use some defaults to resolve the parameters, e.g. simple types come from route or query, complex ones come from body.
Forem Open with the Forem app