我有一堂课叫
MyClass
此类继承 IEquatable 并实现等于我需要的方式。(意思是:当我在代码中单独比较两个 MyClass 类型对象时,它可以工作)
然后我创建两个列表:
var ListA = new List<MyClass>();
var ListB = new List<MyClass>();
// Add distinct objects that are equal to one another to
// ListA and ListB in such a way that they are not added in the same order.
当我去比较 ListA 和 ListB 时,我应该是真的吗?
ListA.Equals(ListB)==true; //???