Hi,
you should override Equals in your 'MyObject' class as follows:
public override bool Equals(object obj)
{
return this.ID == ((MyObject)obj).ID; //if your id is a string use return this.ID.Equals(((MyObject)
}
then when your adding to the distinct list, use if(!List.Contains(objectTo
Main Topics
Browse All Topics





by: gregmulvihillPosted on 2008-06-14 at 10:16:59ID: 21786025
If I understand what you are looking for, this should work. Though, I can't claim this is the 'best way' to achieve your goal, it does seem to be a simplest way that works.
Select allOpen in new window