I have added a class in ConfigureServices(IServiceCollection services) as services.AddInstance<IConfiguration>(Configuration);I want to get the instance in my HostConfiguration.cs class, I can get it in controller, problem is how can i get it in any other
class?
In unity we can use ServiceLocator to get instance, Now in MVC 6 how can i get it?
↧
How to get instance using IServiceCollection
↧