【发布时间】:2023-03-07 10:25:01
【问题描述】:
我有一门课叫
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 时,我应该得到 true 吗?
ListA.Equals(ListB)==true; //???
【问题讨论】:
标签: c# .net list iequatable iequalitycomparer