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

Definition

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);
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ComVisible(false)]
public static bool Equals<T> (Nullable<T> n1, Nullable<T> n2) where T : struct;
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

Type Parameters

T

The underlying value type of the n1 and n2 parameters.

Parameters

Returns

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.

Applies to