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;
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

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

true je-li n1 parametr roven parametru n2 ; falsev opačném případě .

Vrácená hodnota závisí na HasValue dvou porovnávaných parametrech a Value vlastnostech.

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

Platí pro