MongoDB.Driver.MongoCredentialsStore.Equals C# (CSharp) Метод

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

Compares this credentials store to another credentials store.
public Equals ( MongoCredentialsStore rhs ) : bool
rhs MongoCredentialsStore The other credentials store.
Результат bool
        public bool Equals(MongoCredentialsStore rhs)
        {
            if (object.ReferenceEquals(rhs, null) || GetType() != rhs.GetType()) {
                return false;
            }

            if (_credentialsStore.Count != rhs._credentialsStore.Count)
            {
                return false;
            }

            foreach (var key in _credentialsStore.Keys)
            {
                if (!rhs._credentialsStore.ContainsKey(key))
                {
                    return false;
                }
                if (!_credentialsStore[key].Equals(rhs._credentialsStore[key]))
                {
                    return false;
                }
            }

            return true;
        }

Same methods

MongoCredentialsStore::Equals ( object obj ) : bool

Usage Example

        /// <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);
                }
            }
        }
All Usage Examples Of MongoDB.Driver.MongoCredentialsStore::Equals