示例#1
0
        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));
        }
示例#2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <WebPortalDbContext>(configuration =>
         {
             WebPortalDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
         });
     }
 }