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