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

Definice

Porovná relativní hodnoty dvou Nullable<T> objektů.

public:
generic <typename T>
 where T : value class static int Compare(Nullable<T> n1, Nullable<T> n2);
public static int Compare<T>(T? n1, T? n2) where T : struct;
[System.Runtime.InteropServices.ComVisible(true)]
public static int Compare<T>(T? n1, T? n2) where T : struct;
static member Compare : Nullable<'T (requires 'T : struct)> * Nullable<'T (requires 'T : struct)> -> int (requires 'T : struct)
[<System.Runtime.InteropServices.ComVisible(true)>]
static member Compare : Nullable<'T (requires 'T : struct)> * Nullable<'T (requires 'T : struct)> -> int (requires 'T : struct)
Public Shared Function Compare(Of T As Structure) (n1 As Nullable(Of T), n2 As Nullable(Of T)) As Integer

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

Celé číslo, které označuje relativní hodnoty n1 parametrů a n2 parametrů.

Návratová hodnota Popis
Menší než nula Vlastnost HasValuen1 je falsea HasValue vlastnost n2trueje , nebo HasValue vlastnosti pro n1 a n2 jsou truea hodnota Value vlastnosti pro n1 je menší než hodnota Value vlastnosti pro n2.
Nula Vlastnosti HasValue pro a jsou nebo vlastnosti a n1n2 jsou falsea hodnota HasValue vlastnosti pro n1 je rovna hodnotě n2 vlastnosti pro true.Valuen1Valuen2
Větší než nula Vlastnost HasValuen1 je truea HasValue vlastnost n2 je false, nebo HasValue vlastnosti pro n1 a n2 jsou truea hodnota Value vlastnosti pro n1 je větší než hodnota Value vlastnosti pro n2.
Atributy

Platí pro