Compare two objects in c#

added by DotNetKicks
10/12/2018 2:18:04 PM

1 Kicks, 1558 Views

You may want to compare objects for various reasons, here is one way you can do it in C#. This way only supports a same type of objects. Here I am using reflection to get values from object's properties and compare them.