System.Nullable<T>.Value Property

Gets the value of the current Nullable`1 object if it has been assigned a valid underlying value.

Syntax

public T Value { get; }

Value

The value of the current instance.

Exceptions

TypeReason
InvalidOperationException Nullable<T>.HasValue is false.

Remarks

If a value of type T has not been assigned to the Nullable`1 object, you can compare it to null and retrieve its Nullable`1.HasValue property, but you cannot access its Nullable`1.Value property or call its other members.

Requirements

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