Allow non-attribute routing for ApiController
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
I am trying to use non-attribute routing for my `ApiController` but when I try to `UseEndpoints()` throws the exception:
> System.InvalidOperationException: 'Action 'Controllers.Api.WeatherForecastController.Get' does not have an attribute route. Action methods on controllers annotated with ApiControllerAttribute must be attribute routed.'
### Describe the solution you'd like
`ApiController`s should support non-attribute routing.
### Additional context
It's regularly stated that attribute routing becomes a requirement when a controller is an `ApiController`. What I don't understand is *why*. It seems completely arbitrary. Can't it be opened up to non-attribute routing, or does this cause some technical problem?
Contributor guide
Assessment
This issue has not been assessed yet.