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