MongoDB.Driver.MongoCredentialsStore.Freeze C# (CSharp) Method

Freeze() public method

Freezes the credentials store.
public Freeze ( ) : MongoCredentialsStore
return MongoCredentialsStore
        public MongoCredentialsStore Freeze()
        {
            if (!_isFrozen)
            {
                _frozenHashCode = GetHashCode();
                _frozenStringRepresentation = ToString();
                _isFrozen = true;
            }
            return this;
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Freezes the settings.
 /// </summary>
 /// <returns>The frozen settings.</returns>
 public MongoServerSettings Freeze()
 {
     if (!_isFrozen)
     {
         _credentialsStore.Freeze();
         _readPreference             = _readPreference.FrozenCopy();
         _writeConcern               = _writeConcern.FrozenCopy();
         _frozenHashCode             = GetHashCode();
         _frozenStringRepresentation = ToString();
         _isFrozen = true;
     }
     return(this);
 }