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

            HierarchicalTenancyTestDbContextConfigurer.Configure(builder, configuration.GetConnectionString(HierarchicalTenancyTestConsts.ConnectionStringName));

            return(new HierarchicalTenancyTestDbContext(builder.Options));
        }
Ejemplo n.º 2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <HierarchicalTenancyTestDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 HierarchicalTenancyTestDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 HierarchicalTenancyTestDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }