c# - Using Object.Equals(Object) with a reference type -
i'm trying use method object.equals(object)
compare 2 different instances of class have created need compare value not reference of instances.
researching subject i've found need use value types, struct, in order able use method equals
compare value of instances , not reference have large library of classes i'm afraid of change type class struct because don't know other consequences have...any advice whay should do?
can override method equals class compare values instead reference? know lot of ways ir what's 1 give best performance , "programming correction"...?
yes, have override equals method , == operator of class , in write comparison logic.
for more read
guidelines overloading equals() , operator == (c# programming guide)
Comments
Post a Comment