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

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

Creates a clone of the credentials store.
public Clone ( ) : MongoCredentialsStore
Результат MongoCredentialsStore
        public MongoCredentialsStore Clone()
        {
            var clone = new MongoCredentialsStore();
            foreach (var item in _credentialsStore)
            {
                clone.AddCredentials(item.Key, item.Value);
            }
            return clone;
        }

Usage Example

Пример #1
0
 // public methods
 /// <summary>
 /// Creates a clone of the settings.
 /// </summary>
 /// <returns>A clone of the settings.</returns>
 public MongoServerSettings Clone()
 {
     return(new MongoServerSettings(_connectionMode, _connectTimeout, _credentialsStore.Clone(), _defaultCredentials,
                                    _guidRepresentation, _ipv6, _maxConnectionIdleTime, _maxConnectionLifeTime, _maxConnectionPoolSize,
                                    _minConnectionPoolSize, _replicaSetName, _safeMode, _servers, _slaveOk, _socketTimeout,
                                    _waitQueueSize, _waitQueueTimeout));
 }
All Usage Examples Of MongoDB.Driver.MongoCredentialsStore::Clone