title: Best way to compare two Dictionary<T> for equality
body: <p>Is this the best way to create a comparer for the equality of two dictionaries? This needs to be exact. Note that Entity.Columns is a dictionary of KeyValuePair(string, object) :</p>
  
  <pre><code>public class EntityColumnCompare : IEqualityComparer&lt;Entity&gt;
  {
      public bool Equals(Entity a, Entity b)
      {
          var aCol = a.Columns.OrderBy(KeyValuePair =&gt; KeyValuePair.Key);
          var bCol = b.Columns.OrderBy(KeyValuePAir =&gt; KeyValuePAir.Key); 
  
          if (aCol.SequenceEqual(bCol))
              return true;
          else
              return false;           
      }
  
      public int GetHashCode(Entity obj)
      {
          return obj.Columns.GetHashCode(); 
      }
  }
  </code></pre>
  
  <p>Also not too sure about the GetHashCode implementation.</p>
  
  <p>Thanks!</p>