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

            YaeherDoctorAPIDbContextConfigurer.Configure(builder, configuration.GetConnectionString(YaeherConsts.ConnectionStringName));

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