DataRowComparer<TRow> DataRowComparer<TRow> DataRowComparer<TRow> DataRowComparer<TRow> Class

定義

比較兩個DataRow物件,使用值為基礎的比較是否相等。Compares two DataRow objects for equivalence by using value-based comparison.

generic <typename TRow>
 where TRow : DataRowpublic ref class DataRowComparer sealed : System::Collections::Generic::IEqualityComparer<TRow>
public sealed class DataRowComparer<TRow> : System.Collections.Generic.IEqualityComparer<TRow> where TRow : DataRow
type DataRowComparer<'Row (requires 'Row :> DataRow)> = class
    interface IEqualityComparer<'Row (requires 'Row :> DataRow)>
Public NotInheritable Class DataRowComparer(Of TRow)
Implements IEqualityComparer(Of TRow)

類型參數

TRow

要比較,通常是物件的型別DataRowThe type of objects to be compared, typically DataRow.

繼承
DataRowComparer<TRow>DataRowComparer<TRow>DataRowComparer<TRow>DataRowComparer<TRow>
實作

備註

這個類別會實作IEqualityComparer<T>介面,並使用值為基礎的語意來比較DataRow物件。This class implements the IEqualityComparer<T> interface and uses value-based semantics to compare DataRow objects. 這個類別是必要的因為一些集合式作業的預設實作 (例如DistinctUnionIntersect,以及Except) 使用參考為基礎的語意來比較DataRow物件參考,而不是比較DataRow物件值。This class is required because the default implementations of some set-based operations (such as Distinct, Union, Intersect, and Except) use reference-based semantics to compare DataRow object references, instead of comparing the DataRow object values. Default類別用來比較值DataRow物件,並不會比較的物件參考。The Default class is used to compare the values of the DataRow objects and does not compare the object references.

此類別無法直接具現化。This class cannot be directly instantiated. 相反地,Default屬性必須用來傳回的單一執行個體Default類別。Instead, the Default property must be used to return a singleton instance of the Default class.

這個類別是無狀態。This class is stateless.

這個類別密封格式,而且不能衍生自。This class is sealed and cannot be derived from.

屬性

Default Default Default Default

取得單一執行個體DataRowComparer<TRow>Gets a singleton instance of DataRowComparer<TRow>. 這個屬性是唯讀的。This property is read-only.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Equals(TRow, TRow) Equals(TRow, TRow) Equals(TRow, TRow) Equals(TRow, TRow)

比較兩個DataRow使用資料行的資料行、 值為基礎的比較的物件。Compares two DataRow objects by using a column-by-column, value-based comparison.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetHashCode(TRow) GetHashCode(TRow) GetHashCode(TRow) GetHashCode(TRow)

傳回指定的雜湊碼DataRow物件。Returns a hash code for the specified DataRow object.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

適用於

另請參閱