I\'m creating a class that derives from List...
public class MyList : List
{}
I\'ve overridden Eq
public class MyList : List
{
public override bool Equals(object obj)
{
if (obj == null)
return false;
MyList list = obj as MyList;
if (list == null)
return false;
if (list.Count != this.Count)
return false;
bool same = true;
this.ForEach(thisItem =>
{
if (same)
{
same = (null != list.FirstOrDefault(item => item.Equals(thisItem)));
}
});
return same;
}
}