I have a list that contains many objects.I want found an object in this list that every properties equals to an object in list.
for example:
list.Add(object1,object2,object3,object4);
// for example I want found object3
//list.find(object3)
and I have a problem I must check every its properties except one. for example object have this properties (int prop1,int prop2,int prop3). I want found object that prop1 and prop2 are equaled with any item of list;
Override the Equals method would be a way to go.
Or you can try to write a find function use reflection to dynamically check the properties of those Objects.
Please check the article here: http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/