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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -