public AbpCoreDemoDbContext Create(DbContextFactoryOptions options)
        {
            var builder       = new DbContextOptionsBuilder <AbpCoreDemoDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            AbpCoreDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AbpCoreDemoConsts.ConnectionStringName));

            return(new AbpCoreDemoDbContext(builder.Options));
        }
Пример #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <AbpCoreDemoDbContext>(configuration =>
         {
             AbpCoreDemoDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
         });
     }
 }