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