I have a .NET Core 3 Web Api application and I need, during the Startup process, access all of my Controllers methods to see what attributes they have and save this info into a dictionary.
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers(); // is is possible to get more info about the controllers here?
}
I know that I can achieve this using reflection, searching all classes with Controller in the binary and looping through their methods and accessing their atributes. My question is: is there another way? Since I need to add the Controllers in Startup, maybe I can get more info about them?