public MyFisrtProjectASPNETZERODbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder <MyFisrtProjectASPNETZERODbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); MyFisrtProjectASPNETZERODbContextConfigurer.Configure(builder, configuration.GetConnectionString(MyFisrtProjectASPNETZEROConsts.ConnectionStringName)); return(new MyFisrtProjectASPNETZERODbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <MyFisrtProjectASPNETZERODbContext>(options => { if (options.ExistingConnection != null) { MyFisrtProjectASPNETZERODbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { MyFisrtProjectASPNETZERODbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } }