Last post May 28, 2018 05:30 AM by Nan Yu
May 28, 2018 01:07 AM|uid390594|LINK
for example, i have two object instances of the same Customer Class.
one is an updated version of the other, and i want to check if anything has changed. to prevent unnecesary IO operations and to not save it when its not different. because every save costs 7 milliseconds. saving 10.000 models would be taking 1 minute 10
so can i see if they are different without checking each variable field?
For example, what does this do? or is this what im looking for? and has this unwanted side effects?
If Custumer1 = customer2
May 28, 2018 02:26 AM|DA924|LINK
May 28, 2018 05:30 AM|Nan Yu|LINK
Hi fazioliamboina ,
You should use Equals to check for equality (overriding object.Equals as necessary) and implement IEquatable<T> as well to provide slightly better performance :