Table of Contents

Method GetOrDefault

Namespace
MongoDB.Driver.Core.WireProtocol.Messages.Encoders
Assembly
MongoDB.Driver.Core.dll

GetOrDefault<T>(string, T)

Gets a setting, or a default value if the setting does not exist.

public T GetOrDefault<T>(string name, T defaultValue)

Parameters

name string

The name.

defaultValue T

The default value.

Returns

T

The value of the setting, or a default value if the setting does not exist.

Type Parameters

T

The type of the value.