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

Definisi

Membandingkan nilai relatif dari dua Nullable<T> objek.

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

Jenis parameter

T

Jenis nilai yang n1 mendasar dari parameter dan n2 .

Parameter

Mengembalikan

Bilangan bulat yang menunjukkan nilai relatif parameter n1 dan n2 .

Mengembalikan Nilai Deskripsi
Kurang dari nol Properti HasValue untuk n1 adalah false, dan HasValue properti untuk n2 adalah true, atau HasValue properti untuk n1 dan n2 adalah true, dan nilai Value properti untuk n1 kurang dari nilai Value properti untuk n2.
Nol Properti untuk dan adalah , atau HasValue properti untuk n1 dan n2 adalah false, dan nilai HasValue properti untuk n1 sama dengan nilai n2 properti untuk true.Valuen1Valuen2
Lebih besar dari nol Properti HasValue untuk n1 adalah true, dan HasValue properti untuk n2 adalah false, atau HasValue properti untuk n1 dan n2 adalah true, dan nilai Value properti untuk n1 lebih besar dari nilai Value properti untuk n2.
Atribut

Berlaku untuk