title: Comparing dynamic objects in C#
body: <p>What is the best way to compare two arbitrary dynamic objects for equality? For example these two objects.</p>
  
  <p>I.e.</p>
  
  <pre><code>dynamic obj1 = new ExpandoObject();
  obj1.Name = "Marcus";
  obj1.Age = 39;
  obj1.LengthInMeters = 1.96;
  
  dynamic obj2 = AMethodReturningADynamic();
  obj2.Name = "Marcus";
  obj2.Age = 39;
  obj2.LengthInMeters = 1.96;
  
  Assert.AreEqual(obj1, obj2); // ?
  </code></pre>
  
  <p>Or is there a way to get the actual properties and their values as lists? To create an ExpandoObject from a dynamic type for example?</p>