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

Definicja

Wskazuje, czy dwa określone Nullable<T> obiekty są równe.

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;
[System.Runtime.InteropServices.ComVisible(false)]
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)
[<System.Runtime.InteropServices.ComVisible(false)>]
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

Parametry typu

T

Podstawowy typ wartości parametrów n1 i n2 .

Parametry

Zwraca

Boolean

truen1 jeśli parametr jest równy parametrowin2; w przeciwnym razie false.

Wartość zwracana HasValue zależy od właściwości i Value dwóch parametrów, które są porównywane.

Wartość zwracana Opis
true Właściwości HasValue i n1 n2 to false, lub HasValue właściwości n1 i n2true, a Value właściwości parametrów są równe.
false Właściwość HasValue jest true przeznaczona dla jednego parametru i false dla drugiego parametru lub HasValue właściwości n1 parametrów i n2true, a Value właściwości parametrów są nierówne.
Atrybuty

Dotyczy