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