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

Definice

Určuje, zda jsou dva zadané Nullable<T> objekty stejné.

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

Základní typ n1 hodnoty a n2 parametry.

Parametry

n1
Nullable<T>

Objekt Nullable<T> .

n2
Nullable<T>

Objekt Nullable<T> .

Návraty

Boolean

truen1 pokud je parametr roven parametrun2, jinak . false

Vrácená hodnota závisí na HasValue Value vlastnostech dvou parametrů, které se porovnávají.

Návratová hodnota Popis
true Vlastnosti HasValue pro n1 a n2 jsou falsenebo HasValue vlastnosti a n2 n1 jsou truea Value vlastnosti parametrů jsou stejné.
false Vlastnost HasValue je true určená pro jeden parametr a false druhý parametr nebo HasValue vlastnosti a n2 n1 jsou truea Value vlastnosti parametrů jsou nerovné.
Atributy

Platí pro