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