Optional<T>.Value Property

Definition

Gets the value of the current object. Not meaningful unless HasValue returns true.

public:
 property T Value { T get(); };
public T Value { get; }
member this.Value : 'T
Public ReadOnly Property Value As T

Property Value

T

The value if HasValue is true; otherwise, the default value for type T.

Remarks

Unlike Value, this property does not throw an exception when HasValue is false.

Applies to