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

Definicja

Porównuje względne wartości dwóch Nullable<T> obiektów.

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

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

Parametry

Zwraca

Liczba całkowita wskazująca względne wartości parametrów n1 i n2 .

Wartość zwracana Opis
Mniejsze niż zero Właściwość HasValue dla n1 parametru to false, a HasValue właściwość n2 dla parametru to true, lub HasValue właściwości n1n2 i to true, a wartość właściwości Value dla parametru jest mniejsza niż wartość n1Value właściwości .n2
Zero Właściwości HasValue właściwości i n1n2 to false, lub HasValue właściwości n1 i n2true, a wartość Value właściwości dla n1 parametru jest równa wartości Value właściwości dla n2.
Większe niż zero Właściwość HasValue dla parametru to n1, a true właściwość HasValue dla parametru to n2, lub false właściwości HasValuen1 i to n2, a wartość właściwości true dla parametru jest większa niż wartość Valuen1 właściwości dla Value.n2
Atrybuty

Dotyczy