Mono Class Library: System.Nullable<T> Overview | Members

System.Nullable<T>.Value Property

Gets the value, if any, of the current instance.

public T Value { get; }

Value

The value of the current instance.

Exceptions

TypeReason
InvalidOperationExceptionNullable<T>.HasValue is false.

Remarks

Operation

If Nullable<T>.HasValue is true, the instance contains a value, and Nullable<T>.Value returns that value.

If Nullable<T>.HasValue is false, the instance contains no value, and an attempt to read Nullable<T>.Value results in an exception.

This property is read-only.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0