c# compare objects
// Add the IEquatable interface to your class
public class MyObject : IEquatable<MyObject>
{
public string ID { get; set; }
public override bool Equals(object obj) { return base.Equals(obj); }
public bool Equals(MyObject other)
{
if (other == null) return false;
return
(object.ReferenceEquals(this.ID, other.ID) ||
this.ID != null && this.ID.Equals(other.ID)) &&
//... Do the above to all your paramters
}
}