Bahasa

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

Definisi

Menunjukkan apakah dua objek yang ditentukan Nullable<T> sama.

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

Jenis parameter

T

Jenis nilai yang n1 mendasar dari parameter dan n2 .

Parameter

Mengembalikan

true n1 jika parameter sama dengan n2 parameter; jika tidak, false.

Nilai pengembalian tergantung pada HasValue properti dan Value dari dua parameter yang dibandingkan.

Mengembalikan Nilai Deskripsi
true Properti HasValue untuk n1 dan n2 adalah false, atau HasValue properti untuk n1 dan n2 adalah true, dan Value properti parameter sama.
false Properti HasValue adalah true untuk satu parameter dan false untuk parameter lain, atau HasValue properti untuk n1 dan n2 adalah true, dan Value properti parameter tidak sama.
Atribut

Berlaku untuk