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