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