public class ClassBEqualityComparer : IEqualityComparer<ClassB>
{
public bool Equals(ClassB x, ClassB y)
{
if((x.var2.Equals(y.var2)) && (x.var3.SequenceEqual(y.var3)) && (x.var4.SequenceEqual(y.var4)))
{
return true;
}
else
{
return false;
}
}
public int GetHashCode(ClassB x)
{
}
}
public class ClassAEqualityComparer : IEqualityComparer<ClassA>
{
public bool Equals(ClassA x, ClassA y)
{
ClassBEqualityComparer ClassBEqC = new ClassBEqualityComparer();
if((x.Type == y.Type) && (x.lst1.SequenceEqual(y.lst1,ClassBEqC)))
{
return true;
}
else
{
return false;
}
}
public int GetHashCode(ClassA x)
{
}
}
ClassAEqualityComparer ClassAEqC = new ClassAEqualityComparer();
bool result = lst1.SequenceEqual(lst2, ClassAEqC);
1
solved How to compare two list of object in c#