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