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