I am attempting to compare a bitwise clone object to its parent to check for changes using:
If Not objCP.Equals(objCPClone) Then
'do something
End If
and it always compares as not equal even immediately after creating the clone.
How should they be compared to check for changes?
Override the
Equalsmethod (andGetHashCodealong the way) to actually check for equality of all necessary fields or properties. The default implementation (inherited fromObject) just checks whether the references are the same (i.e. whether they are pointing to the same object).