public PdnfDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <PdnfDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            PdnfDbContextConfigurer.Configure(builder, configuration.GetConnectionString(PdnfConsts.ConnectionStringName));

            return(new PdnfDbContext(builder.Options));
        }
Beispiel #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <PdnfDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 PdnfDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 PdnfDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }