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