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