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