public WebPortalDbContext Create(DbContextFactoryOptions options) { var builder = new DbContextOptionsBuilder <WebPortalDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); WebPortalDbContextConfigurer.Configure(builder, configuration.GetConnectionString(WebPortalConsts.ConnectionStringName)); return(new WebPortalDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <WebPortalDbContext>(configuration => { WebPortalDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString); }); } }