Implemented a startup task that will instantiate all the DI so first API isn't having to eat that overhead.

This commit is contained in:
Joseph Milazzo 2021-03-13 17:44:29 -06:00
parent 983078de02
commit 6e6e5ee9f2
7 changed files with 100 additions and 7 deletions

View file

@ -56,5 +56,9 @@ namespace API.Extensions
return services;
}
public static IServiceCollection AddStartupTask<T>(this IServiceCollection services)
where T : class, IStartupTask
=> services.AddTransient<IStartupTask, T>();
}
}