Nullable.Equals<T>(Nullable<T>, Nullable<T>) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates whether two specified Nullable<T> objects are equal.
public:
generic <typename T>
where T : value class static bool Equals(Nullable<T> n1, Nullable<T> n2);
public static bool Equals<T>(T? n1, T? n2) where T : struct;
[System.Runtime.InteropServices.ComVisible(true)]
public static bool Equals<T>(T? n1, T? n2) where T : struct;
static member Equals : Nullable<'T (requires 'T : struct)> * Nullable<'T (requires 'T : struct)> -> bool (requires 'T : struct)
[<System.Runtime.InteropServices.ComVisible(true)>]
static member Equals : Nullable<'T (requires 'T : struct)> * Nullable<'T (requires 'T : struct)> -> bool (requires 'T : struct)
Public Shared Function Equals(Of T As Structure) (n1 As Nullable(Of T), n2 As Nullable(Of T)) As Boolean
- T
The underlying value type of the n1
and n2
parameters.
- n1
- Nullable<T>
A Nullable<T> object.
- n2
- Nullable<T>
A Nullable<T> object.
true
if the n1
parameter is equal to the n2
parameter; otherwise, false
.
The return value depends on the HasValue and Value properties of the two parameters that are compared.
Return Value | Description |
---|---|
true | The HasValue properties for n1 and n2 are false , or the HasValue properties for n1 and n2 are true , and the Value properties of the parameters are equal.
|
false | The HasValue property is true for one parameter and false for the other parameter, or the HasValue properties for n1 and n2 are true , and the Value properties of the parameters are unequal.
|
- Attributes
Продукт | Версии |
---|---|
.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 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: