title: ExceptWith in HashSet for complex types
body: <p>I have HashSet of my custom class:</p>
  
  <pre><code>public class Vertex
  {
      public string Name;
  
      public override bool Equals(object obj)
      {
          var vert = obj as Vertex;
          if (vert !=null)
          {
              return Name.Equals(vert.Name, StringComparison.InvariantCulture);
          }
          return false;
      }
  }
  </code></pre>
  
  <p>And now I have tow hashsets</p>
  
  <pre><code>HashSet&lt;Vertex&gt; hashSet1 = new HashSet&lt;Vertex&gt;();
  
  HashSet&lt;Vertex&gt; hashSet1 = new HashSet&lt;Vertex&gt;();
  </code></pre>
  
  <p>And now I'd like to have in hashSet1 only Vertexes that are not in hashSet2
  So I use ExceptWith method</p>
  
  <pre><code>hashSet1.ExceptWith(hashSet2);
  </code></pre>
  
  <p>But this doesn't work.
  I suppose that this doesn't work because I have complex type.
  So the question is: is there some interface required to be implemented in Vertex class to make this thing work?
  I know that while creation of HashSet I can pass a EqualityComparer but it seems to me that it would be more elegant to implement some comparing interface method in Vertex class.</p>
  
  <p>Is it possible or I just doesn't understand sth?</p>
  
  <p>Thanks.</p>