Språk

Type.GetNullableUnderlyingType Method

Definition

Gets the underlying type argument of the current nullable type.

public:
 virtual Type ^ GetNullableUnderlyingType();
public virtual Type? GetNullableUnderlyingType();
abstract member GetNullableUnderlyingType : unit -> Type
override this.GetNullableUnderlyingType : unit -> Type
Public Overridable Function GetNullableUnderlyingType () As Type

Returns

The underlying type argument if the current type is a constructed Nullable<T> type; otherwise, null.

Exceptions

The current type is a derived type that doesn't override this method.

Remarks

Derived classes must override this method. The base implementation throws NotSupportedException.

Applies to