Пример #1
0
        /// <inheritdoc/>
        protected override void CopyFrom(ConfigurationBase source)
        {
            base.CopyFrom(source);
            var configuration = (SessionConfiguration)source;

            UserName  = configuration.UserName;
            Password  = configuration.Password;
            options   = configuration.options;
            CacheType = configuration.CacheType;
            CacheSize = configuration.CacheSize;
            BatchSize = configuration.BatchSize;
            EntityChangeRegistrySize = configuration.EntityChangeRegistrySize;
            ReaderPreloading         = configuration.readerPreloading;
            DefaultIsolationLevel    = configuration.DefaultIsolationLevel;
            DefaultCommandTimeout    = configuration.DefaultCommandTimeout;
            ServiceContainerType     = configuration.ServiceContainerType;
            ConnectionInfo           = configuration.connectionInfo;
        }
        /// <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();
        }
 /// <summary>
 /// Copies the properties from the <paramref name="source"/>
 /// configuration to this one.
 /// Used by <see cref="Clone"/> method implementation.
 /// </summary>
 /// <param name="source">The configuration to copy properties from.</param>
 protected virtual void CopyFrom(ConfigurationBase source)
 {
     // Does nothing in this class.
 }