Update* I am so sorry... my sample code contained an error which resulted in a lot of answers I didn\'t understand. In stead of
Console.WriteLin
Compare the output of typeof() first, so you make sure you are comparing the same type of objects, then write an Equals method on X class which takes another instance of X class, and compare all properties... once you find something different, return false, else keep going till you return true.
Cheers :)