private void BuildDomain(DomainUpgradeMode upgradeMode)
        {
            CleanDomain();

            var config = DomainConfigurationFactory.Create();

            config.NamingConvention.NamespacePolicy = NamespacePolicy.Synonymize;
            config.NamingConvention.NamespaceSynonyms[typeof(NonClustered.Root).Namespace]    = "NC";
            config.NamingConvention.NamespaceSynonyms[typeof(Clustered.Root).Namespace]       = "C";
            config.NamingConvention.NamespaceSynonyms[typeof(CustomClustered.Root).Namespace] = "CC";
            config.NamingConvention.NamespaceSynonyms[typeof(ErrorCases.DuplicateClusteredIndex).Namespace] = "E";

            foreach (var type in domainTypes)
            {
                config.Types.Register(type);
            }
            config.Types.Register(typeof(SingleTableSchemaModifier).Assembly, typeof(SingleTableSchemaModifier).Namespace);

            config.UpgradeMode = upgradeMode;
            if (inheritanceSchema != null)
            {
                InheritanceSchemaModifier.ActivateModifier(inheritanceSchema.Value);
            }
            else
            {
                InheritanceSchemaModifier.DeactivateModifiers();
            }

            domain = Domain.Build(config);
        }
        private Domain BuildDomain(InheritanceSchema schema)
        {
            var configuration = DomainConfigurationFactory.Create();

            configuration.Types.Register(typeof(ParentEntity).Assembly, typeof(ParentEntity).Namespace);
            configuration.Types.Register(typeof(ClassTableSchemaModifier));
            configuration.Types.Register(typeof(SingleTableSchemaModifier));
            configuration.Types.Register(typeof(SingleTableSchemaModifier));
            InheritanceSchemaModifier.ActivateModifier(schema);
            return(Domain.Build(configuration));
        }