ASP.NET Core — How to use Dependency Injection in Entity Framework Core
▻https://hackernoon.com/asp-net-core-how-to-use-dependency-injection-in-entity-framework-core-43
ASP.NET Core — How to use Dependency Injection in Entity Framework CoreDependency Injection with Entity Framework CoreASP.NET Core has an excellent Dependency Injection feature through which this framework provides you with an object of any class that you want. So you don’t have to manually create the class object in your code.In this tutorial I will teach you how to use the Dependency Injection method in Entity Framework Core. This will provide you can get the following benefits:1. The object of ‘DbContext’ class through Dependency Injection.2. Fetch the connection string from ‘appsettings.json’ instead of from ‘OnConfiguring()’ method of ‘DbContext’ class.Connection String inside OnConfiguring() methodNormally you provide your database connection string in OnConfiguring() method of DbContext (...)
#entity-framework-core #aspnetcore #dependency-injection #software-developmen #aspnet