コード例 #1
0
        public XiongHuiDbContext Create(DbContextFactoryOptions options)
        {
            var builder       = new DbContextOptionsBuilder <XiongHuiDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            XiongHuiDbContextConfigurer.Configure(builder, configuration.GetConnectionString(XiongHuiConsts.ConnectionStringName));

            return(new XiongHuiDbContext(builder.Options));
        }
コード例 #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <XiongHuiDbContext>(configuration =>
         {
             XiongHuiDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
         });
     }
 }