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