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

            PostgreSqlDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(PostgreSqlDemoConsts.ConnectionStringName));

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