title: Sortedset not using custom equals
body: <p>My class implements IEquatable and IComparable. It then gets added to a sortedset. </p>
  
  <p>The goal is to have it be sorted by its "Date" property and be equal if both "ID1" and "ID2" are the same. </p>
  
  <p>The implemented methods:</p>
  
  <pre><code>public int CompareTo(MyClass other)
  {
      return other.Date.CompareTo(Date);
  }
  
  public override int GetHashCode()
  {
      unchecked
      {
          var hashCode = ID1;
          hashCode = (hashCode * 397) ^ ID2;
          return hashCode;
      }
  }
  
  public bool Equals(MyClass other)
  {
      if (ReferenceEquals(null, other)) 
         return false;
  
      if (ReferenceEquals(this, other)) 
         return true;
  
      return ID1 == other.ID1
          &amp;&amp; ID2 == other.ID2;
  }
  </code></pre>
  
  <p>The resulting sortedset is correctly sorted, but there are still elements that should be equal and therefore not in the set. Using breakpoints it seems neither GetHashCode nor Equals get called. </p>
  
  <p>Any tips on how to solve this?</p>