Table of Contents

Method With

Namespace
MongoDB.Driver.Core.Configuration
Assembly
MongoDB.Driver.Core.dll

With(Optional<IEnumerable<IAuthenticatorFactory>>, Optional<IEnumerable<CompressorConfiguration>>, Optional<LibraryInfo>, Optional<bool>, Optional<TimeSpan>, Optional<TimeSpan>, Optional<string>)

Returns a new ConnectionSettings instance with some settings changed.

public ConnectionSettings With(Optional<IEnumerable<IAuthenticatorFactory>> authenticatorFactories = default, Optional<IEnumerable<CompressorConfiguration>> compressors = default, Optional<LibraryInfo> libraryInfo = default, Optional<bool> loadBalanced = default, Optional<TimeSpan> maxIdleTime = default, Optional<TimeSpan> maxLifeTime = default, Optional<string> applicationName = default)

Parameters

authenticatorFactories Optional<IEnumerable<IAuthenticatorFactory>>

The authenticator factories.

compressors Optional<IEnumerable<CompressorConfiguration>>

The compressors.

libraryInfo Optional<LibraryInfo>

The library information.

loadBalanced Optional<bool>

Whether the load balanced mode is enabled.

maxIdleTime Optional<TimeSpan>

The maximum idle time.

maxLifeTime Optional<TimeSpan>

The maximum life time.

applicationName Optional<string>

The application name.

Returns

ConnectionSettings

A new ConnectionSettings instance.