System.Nullable<T>.op_Explicit Method
Perform an explicit conversion of a Nullable<T> value to type T.

Syntax

public static explicit operator T (Nullable<T> value)

Parameters

value
The Nullable<T> value to convert to type T.

Returns

The value, if any, of the specified nullable value. Otherwise, a InvalidOperationException is thrown.

Exceptions

TypeReason
InvalidOperationException Nullable<T>.HasValue is false.

Remarks

Note: The conversion implemented by this method corresponds exactly to obtaining the value of the Nullable<T>.Value property.

Requirements

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