Table of Contents

Struct Optional<T>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Represents an optional parameter that might or might not have a value.

public struct Optional<T>

Type Parameters

T

The type of the parameter.

Inherited Members

Constructors

Optional(T)

Initializes a new instance of the Optional<T> struct with a value.

Properties

HasValue

Gets a value indicating whether the optional parameter has a value.

Value

Gets the value of the optional parameter.

Methods

Replaces(T)

Returns a value indicating whether this optional parameter contains a value that is not equal to an existing value.

WithDefault(T)

Returns either the value of this optional parameter if it has a value, otherwise a default value.

Operators

implicit operator Optional<T>(T)

Performs an implicit conversion from to an Optional<T> with a value.