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