Equals() публичный Метод

Compares this credentials store to another credentials store.
public Equals ( MongoCredentialsStore rhs ) : bool
rhs MongoCredentialsStore The other credentials store.
Результат bool
        /// <summary>
        /// Compares two MongoServerSettings instances.
        /// </summary>
        /// <param name="obj">The other instance.</param>
        /// <returns>True if the two instances are equal.</returns>
        public override bool Equals(object obj)
        {
            var rhs = obj as MongoServerSettings;

            if (rhs == null)
            {
                return(false);
            }
            else
            {
                if (_isFrozen && rhs._isFrozen)
                {
                    return(_frozenStringRepresentation == rhs._frozenStringRepresentation);
                }
                else
                {
                    return
                        (_connectionMode == rhs._connectionMode &&
                         _connectTimeout == rhs._connectTimeout &&
                         _credentialsStore.Equals(rhs._credentialsStore) &&
                         _defaultCredentials == rhs._defaultCredentials &&
                         _guidRepresentation == rhs._guidRepresentation &&
                         _ipv6 == rhs._ipv6 &&
                         _maxConnectionIdleTime == rhs._maxConnectionIdleTime &&
                         _maxConnectionLifeTime == rhs._maxConnectionLifeTime &&
                         _maxConnectionPoolSize == rhs._maxConnectionPoolSize &&
                         _minConnectionPoolSize == rhs._minConnectionPoolSize &&
                         _readPreference == rhs._readPreference &&
                         _replicaSetName == rhs._replicaSetName &&
                         _secondaryAcceptableLatency == rhs._secondaryAcceptableLatency &&
                         _servers.SequenceEqual(rhs._servers) &&
                         _socketTimeout == rhs._socketTimeout &&
                         _useSsl == rhs._useSsl &&
                         _verifySslCertificate == rhs._verifySslCertificate &&
                         _waitQueueSize == rhs._waitQueueSize &&
                         _waitQueueTimeout == rhs._waitQueueTimeout &&
                         _writeConcern == rhs._writeConcern);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Compares two MongoServerSettings instances.
        /// </summary>
        /// <param name="obj">The other instance.</param>
        /// <returns>True if the two instances are equal.</returns>
        public override bool Equals(object obj)
        {
            var rhs = obj as MongoServerSettings;

            if (rhs == null)
            {
                return(false);
            }
            else
            {
                if (_isFrozen && rhs._isFrozen)
                {
                    return(_frozenStringRepresentation == rhs._frozenStringRepresentation);
                }
                else
                {
                    return
                        (_connectionMode == rhs._connectionMode &&
                         _connectTimeout == rhs._connectTimeout &&
                         _credentialsStore.Equals(rhs._credentialsStore) &&
                         _defaultCredentials == rhs._defaultCredentials &&
                         _guidRepresentation == rhs._guidRepresentation &&
                         _ipv6 == rhs._ipv6 &&
                         _maxConnectionIdleTime == rhs._maxConnectionIdleTime &&
                         _maxConnectionLifeTime == rhs._maxConnectionLifeTime &&
                         _maxConnectionPoolSize == rhs._maxConnectionPoolSize &&
                         _minConnectionPoolSize == rhs._minConnectionPoolSize &&
                         _replicaSetName == rhs._replicaSetName &&
                         _safeMode == rhs._safeMode &&
                         (_servers == null && rhs._servers == null || _servers.SequenceEqual(rhs._servers)) &&
                         _slaveOk == rhs._slaveOk &&
                         _socketTimeout == rhs._socketTimeout &&
                         _waitQueueSize == rhs._waitQueueSize &&
                         _waitQueueTimeout == rhs._waitQueueTimeout);
                }
            }
        }