Example #1
0
 /// <inheritdoc/>
 protected override void Process(TypeRegistry registry, TypeRegistration registration, Type type)
 {
     if (type == null || registry.Contains(type))
     {
         return;
     }
     if (!DomainTypeRegistry.IsInterestingType(type))
     {
         return;
     }
     // The type is interesting;
     // If it is a persistent type, let's register all its bases
     if (DomainTypeRegistry.IsPersistentType(type))
     {
         Process(registry, registration, type.BaseType);
     }
     Type[] interfaces = type.FindInterfaces(
         (_type, filterCriteria) => DomainTypeRegistry.IsPersistentType(_type), type);
     for (int index = 0; index < interfaces.Length; index++)
     {
         Process(registry, registration, interfaces[index]);
     }
     // Final registration
     base.Process(registry, registration, type);
 }
        /// <summary>
        /// Copies the properties from the <paramref name="source"/>
        /// configuration to this one.
        /// Used by <see cref="ConfigurationBase.Clone"/> method implementation.
        /// </summary>
        /// <param name="source">The configuration to copy properties from.</param>
        /// <inheritdoc/>
        protected override void CopyFrom(ConfigurationBase source)
        {
            base.CopyFrom(source);

            var configuration = (DomainConfiguration)source;

            name                            = configuration.Name;
            connectionInfo                  = configuration.ConnectionInfo;
            defaultSchema                   = configuration.DefaultSchema;
            defaultDatabase                 = configuration.DefaultDatabase;
            types                           = (DomainTypeRegistry)configuration.Types.Clone();
            linqExtensions                  = (LinqExtensionRegistry)configuration.LinqExtensions.Clone();
            namingConvention                = (NamingConvention)configuration.NamingConvention.Clone();
            keyCacheSize                    = configuration.KeyCacheSize;
            keyGeneratorCacheSize           = configuration.KeyGeneratorCacheSize;
            queryCacheSize                  = configuration.QueryCacheSize;
            recordSetMappingCacheSize       = configuration.RecordSetMappingCacheSize;
            sessions                        = (SessionConfigurationCollection)configuration.Sessions.Clone();
            upgradeMode                     = configuration.UpgradeMode;
            foreignKeyMode                  = configuration.ForeignKeyMode;
            serviceContainerType            = configuration.ServiceContainerType;
            includeSqlInExceptions          = configuration.IncludeSqlInExceptions;
            forcedServerVersion             = configuration.ForcedServerVersion;
            buildInParallel                 = configuration.BuildInParallel;
            allowCyclicDatabaseDependencies = configuration.AllowCyclicDatabaseDependencies;
            collation                       = configuration.Collation;
            connectionInitializationSql     = configuration.ConnectionInitializationSql;
            schemaSyncExceptionFormat       = configuration.SchemaSyncExceptionFormat;
            multidatabaseKeys               = configuration.MultidatabaseKeys;
            ensureConnectionIsAlive         = configuration.EnsureConnectionIsAlive;
            options                         = configuration.Options;
            databases                       = (DatabaseConfigurationCollection)configuration.Databases.Clone();
            mappingRules                    = (MappingRuleCollection)configuration.MappingRules.Clone();
            keyGenerators                   = (KeyGeneratorConfigurationCollection)configuration.KeyGenerators.Clone();
            ignoreRules                     = (IgnoreRuleCollection)configuration.IgnoreRules.Clone();
            shareStorageSchemaOverNodes     = configuration.ShareStorageSchemaOverNodes;
            versioningConvention            = (VersioningConvention)configuration.VersioningConvention.Clone();
        }