I have a List.
class MyClass
{
public int Prop1...
public int Prop2...
public int Prop3...
}
you need to use .Distinct(..); extension method.
Here's a quick sample:
public class Comparer : IEqualityComparer
{
public bool Equals(Point x, Point y)
{
return x.X == y.X;
}
public int GetHashCode(Point obj)
{
return (int)obj.X;
}
}
Do not forget about GetHashCode.
Usage:
List p = new List();
// add items
p.Distinct(new Comparer());