Extension Method To Compare 2 Objects https://stackoverflow.com/questions/10454519/best-way-to-compare-two-complex-objects or use this public static class ObjectComparer { public static bool CompareObj(this object source, object destination) { if (!source.GetType().Equals(destination.GetType())) return false; var properties = source.GetType().GetProperties(); foreach (var item in properties) if (!item.GetValue(source, null).Equals(item.GetValue(destination))) return false; return true; } } Usage Create 2 classes. class Program { static void Main(string[] args) { ...
I jot down whatever I learn from different sources.Written for personal use. But anyone can learn.