what I would do is create a registry service method like this:
public static void AddMyTools(this IServiceCollection services, IConfiguration config){
In this static method, I will save the configurations that I need in this static class.
Then in Startup.cs I will use the namespace of my tools, and then in the ConfigureServices section I will add the following tools:
services.AddMyTools(Configuration);
Hope this helps you. I have not tried, maybe, some changes, but you have a global idea. (I was looking for this, and @Sam Farajpour Ghamari gave me an idea with his answer)
source share