Adding [ApiController] on a controller class has various benefits. Especially the automatic model validation and problem details parts.
The problem with this attribute is that it's easy to forget to add it, so I want to add it globally in one place.
One way to do that is to add this line somewhere in the project.
[assembly: ApiController]
My architecture is a modular monolith, with a single API project that registers controllers from other projects using ConfigureApplicationPartManager . That means that I would need to add [assembly: ApiController] to each project to have it auto applied.
Is there a better way?