title: C# Hashset Contains Non-Unique Objects
body: <p>Using this class</p>
  
  <pre><code>public class Foo
  {
      public string c1, c2;
  
      public Foo(string one, string two)
      {
          c1 = one;
          c2 = two;
      }
  
      public override int GetHashCode()
      {
          return (c1 + c2).GetHashCode();
      }
  }
  </code></pre>
  
  <p>And this HashSet</p>
  
  <pre><code>HashSet&lt;Foo&gt; aFoos = new HashSet&lt;Foo&gt;();
  Foo aFoo = new Foo("a", "b");
  
  aFoos.Add(aFoo);
  aFoos.Add(new Foo("a", "b"));
  
  label1.Text = aFoos.Count().ToString();
  </code></pre>
  
  <p>I get the answer 2, when surely it should be 1. Is there a way to fix this so my HashSet contains only unique objects?</p>
  
  <p>Thanks, Ash.</p>