ASP.NET-Core-MVC-Example
ASP.NET-Core-MVC-Example copied to clipboard
Why don't use the injected IConfiguration in DesignTimeDbContextFactory?
Rather than recreating
IConfigurationRoot configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
again in DesignTimeDbContextFactory.cs, can we leverage the DI just by adding a constructor and a readonly field of type IConfiguration in DesignTimeDbContextFactory?
This opened issue long time ago created. I think that not important because official documentation use the same.