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

            HealthCheckExampleDbContextConfigurer.Configure(builder, configuration.GetConnectionString(HealthCheckExampleConsts.ConnectionStringName));

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