Comparing Objects by Value in .NET

Image for post
Image for post

It is a common fact that the .NET object model, as well as other software program platforms, allow comparing objects by reference and by value.

By default, two objects are equal if the corresponding object variables have the same reference. Otherwise, they are different.

However, in some cases, you may need to state that two objects belonging to the same class are equal if their content match in a certain way.

If you want to know more about comparing objects by Value, read the following articles:

Beginning
Implementation Notes of the Equals Method
Type-specific Equals and Equality Operators
Inheritance & Comparison Operators
Structure Equality Issue
Structure Equality Implementation

Written by

Awesome blog focused on databases and Microsoft, .NET and cloud technologies. http://codingsight.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store