Skip to content

Add Dependency Injection

Latest
Compare
Choose a tag to compare
@kolesnikovav kolesnikovav released this 13 Oct 14:42

You can use DI like follows.

using EfCoreDataChange;

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext(
                RuntimeDBContextExtention<MyDBContext>.RuntimeContextType,
                options =>
                options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"));
        }