Comparing Objects by Value in .NET

{coding}Sight
1 min readMay 11, 2017

--

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

--

--

{coding}Sight
{coding}Sight

Written by {coding}Sight

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

No responses yet