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