使用英语阅读

通过


Nullable 类

定义

支持可分配有 null 的值类型。 此类不能被继承。

C#
public static class Nullable
C#
[System.Runtime.InteropServices.ComVisible(true)]
public static class Nullable
继承
Nullable
属性

注解

有关此 API 的详细信息,请参阅 Nullable 的补充 API 注释

方法

Compare<T>(Nullable<T>, Nullable<T>)

比较两个 Nullable<T> 对象的相对值。

Equals<T>(Nullable<T>, Nullable<T>)

指示所指定的两个 Nullable<T> 对象是否相等。

GetUnderlyingType(Type)

返回指定可以为 null 的类型的基础类型参数。

GetValueRefOrDefaultRef<T>(Nullable<T>)

检索对实例中 Nullable<T> 存储值的位置的只读引用。

适用于

产品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

另请参阅