Hi everyone,
I try to work with native dependency injection of ASP.NET Core 1.0. I work with rc1 update 1 version.
I have an n-tiers application. I would like to get IServiceProvider into DataLayer to obtain my DbContext by service with AddTransient.
Many examples show how to get my DbContext with my controllers like this :
public MyController(IDbContext dbContext) { }
This exemple works very well. But I don't want to use this method because I have to pass my DbContext through my layers.
My question is : How can I get IServiceProvider outside ASP.NET Core scope ?
Thank you for your help.
Greg