Optional(T) Structure (original) (raw)

OptionalT Structure

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

Namespace: MongoDB.Driver
Assembly: MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.10.0+569905ff5e778c38ea19d9d0392496a83e1704ed

Syntax

public struct Optional

Public Structure Optional(Of T)

[] type Optional<'T> = struct end

Type Parameters

T

The type of the parameter.

The OptionalT type exposes the following members.

Constructors

| | Name | Description | | | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------- | | Public method | OptionalT | Initializes a new instance of the OptionalT struct with a value. |

Top

Properties

| | Name | Description | | | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------- | | Public property | HasValue | Gets a value indicating whether the optional parameter has a value. | | Public property | Value | Gets the value of the optional parameter. |

Top

Methods

| | Name | Description | | | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.) | | Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.) | | Public method | GetType | Gets the Type of the current instance. (Inherited from Object.) | | Public method | Replaces | Returns a value indicating whether this optional parameter contains a value that is not equal to an existing value. | | Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.) | | Public method | WithDefault | Returns either the value of this optional parameter if it has a value, otherwise a default value. |

Top

Operators

| | Name | Description | | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------ | | Public operatorStatic member | (T to OptionalT) | Performs an implicit conversion from to an OptionalT with a value. |

Top

Extension Methods

See Also

Reference