语言

Type.GetNullableUnderlyingType 方法

定义

获取当前可为 null 类型的基础类型参数。

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

返回

如果当前类型是构造 Nullable<T> 类型,则为基础类型自变量;否则为 null。

例外

当前类型是不重写此方法的派生类型。

注解

派生类必须重写此方法。 基本实现引发 NotSupportedException。

适用于