/// <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();
        }
Beispiel #2
0
 private LinqExtensionRegistry(LinqExtensionRegistry source)
 {
     registrations = new Dictionary <MemberInfo, LinqExtensionRegistration>(source.registrations);
 }