Given a class with the following definition:
public class MyTestClass
{
public int ValueA { get; set; }
public int ValueB { get; set; }
}
MyTestClass should implement the Equals method.
public bool Equals(MyTestClass x, MyTestClass y)
{
if (Object.ReferenceEquals(x, y)) return true;
if (Object.ReferenceEquals(x, null) ||
Object.ReferenceEquals(y, null))
return false;
return x.ValueA == y.ValueA && y.ValueB == y.ValueB;
}
Here you have a good article about it.
After that you can get a "clean" list of MyTestClass with "Distinct" method.