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