DataRowComparer<TRow>.Equals(TRow, TRow) 方法

定义

通过使用基于值的逐列比较来比较两个 DataRow 对象。Compares two DataRow objects by using a column-by-column, value-based comparison.

public:
 virtual bool Equals(TRow leftRow, TRow rightRow);
public bool Equals (TRow leftRow, TRow rightRow);
public bool Equals (TRow? leftRow, TRow? rightRow);
override this.Equals : 'Row * 'Row -> bool
Public Function Equals (leftRow As TRow, rightRow As TRow) As Boolean

参数

leftRow
TRow

要比较的第一个 DataRow 对象。The first DataRow object to compare.

rightRow
TRow

要比较的第二个 DataRow 对象。The second DataRow object to compare.

返回

Boolean

如果两个 DataRow 对象具有相等的列值有序集,则为 true;否则为 falsetrue if the two DataRow objects have ordered sets of column values that are equal; otherwise, false.

实现

例外

两个源 DataRow 对象之一或全部为 nullOne or both of the source DataRow objects are null.

注解

不检查两个对象的架构 DataRowThe schema of the two DataRow objects is not checked. 如果两个 DataRow 对象具有相同的有序列值集,则将它们视为相等。If both DataRow objects have exactly the same ordered set of column values, they are considered equal.

仅检查对象的当前值 DataRowOnly the current values of the DataRow objects are checked. DataRow不检查对象的状态。The state of the DataRow objects is not checked.

Equals方法是方法的基于值的比较实现 EqualsThe Equals method is the value-based comparison implementation of the Equals method.

适用于