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