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

            AbpNiucaiCoreDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AbpNiucaiCoreConsts.ConnectionStringName));

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