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