ConnectionSettingsWith Method |
Returns a new ConnectionSettings instance with some settings changed.
Namespace:
MongoDB.Driver.Core.Configuration
Assembly:
MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.20.0+ee01960089f28ea1b501690df5fc9f6318a70242
Syntax public ConnectionSettings With(
Optional<IEnumerable<IAuthenticatorFactory>> authenticatorFactories = null,
Optional<IEnumerable<CompressorConfiguration>> compressors = null,
Optional<bool> loadBalanced = null,
Optional<TimeSpan> maxIdleTime = null,
Optional<TimeSpan> maxLifeTime = null,
Optional<string> applicationName = null
)
Public Function With (
Optional authenticatorFactories As Optional(Of IEnumerable(Of IAuthenticatorFactory)) = Nothing,
Optional compressors As Optional(Of IEnumerable(Of CompressorConfiguration)) = Nothing,
Optional loadBalanced As Optional(Of Boolean) = Nothing,
Optional maxIdleTime As Optional(Of TimeSpan) = Nothing,
Optional maxLifeTime As Optional(Of TimeSpan) = Nothing,
Optional applicationName As Optional(Of String) = Nothing
) As ConnectionSettings
member With :
?authenticatorFactories : Optional<IEnumerable<IAuthenticatorFactory>> *
?compressors : Optional<IEnumerable<CompressorConfiguration>> *
?loadBalanced : Optional<bool> *
?maxIdleTime : Optional<TimeSpan> *
?maxLifeTime : Optional<TimeSpan> *
?applicationName : Optional<string>
(* Defaults:
let _authenticatorFactories = defaultArg authenticatorFactories null
let _compressors = defaultArg compressors null
let _loadBalanced = defaultArg loadBalanced null
let _maxIdleTime = defaultArg maxIdleTime null
let _maxLifeTime = defaultArg maxLifeTime null
let _applicationName = defaultArg applicationName null
*)
-> ConnectionSettings
Parameters
- authenticatorFactories (Optional)
- Type: MongoDB.DriverOptionalIEnumerableIAuthenticatorFactory
The authenticator factories. - compressors (Optional)
- Type: MongoDB.DriverOptionalIEnumerableCompressorConfiguration
The compressors. - loadBalanced (Optional)
- Type: MongoDB.DriverOptionalBoolean
Whether the load balanced mode is enabled. - maxIdleTime (Optional)
- Type: MongoDB.DriverOptionalTimeSpan
The maximum idle time. - maxLifeTime (Optional)
- Type: MongoDB.DriverOptionalTimeSpan
The maximum life time. - applicationName (Optional)
- Type: MongoDB.DriverOptionalString
The application name.
Return Value
Type:
ConnectionSettingsA new ConnectionSettings instance.
See Also