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

            D2DDbContextConfigurer.Configure(builder, configuration.GetConnectionString(D2DConsts.ConnectionStringName));

            return(new D2DDbContext(builder.Options));
        }
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <D2DDbContext>(configuration =>
         {
             D2DDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
         });
     }
 }