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