title: HashSet allows duplicate item insertion - C#
body: <p>This kind of seems like a noob question, but I could not find an answer for this question specifically.</p>
  
  <p>I have this class:</p>
  
  <pre><code>public class Quotes{ 
      public string symbol; 
      public string extension
  }
  </code></pre>
  
  <p>And am using this:</p>
  
  <pre><code>HashSet&lt;Quotes&gt; values = new HashSet&lt;Quotes&gt;();
  </code></pre>
  
  <p>However I am able to add the same Quotes object multiple times. For example, my Quotes object may have 'symbol' equal to 'A' and 'extension' equal to '=n', and this Quotes object appears multiple times in the HashSet (viewing Hashset through debug mode). I had thought that when calling</p>
  
  <pre><code>values.Add(new Quotes(symb, ext));
  </code></pre>
  
  <p>with the same symb and ext, 'false' would be returned and the element would not be added. I have a feeling it has something to do with comparing Quotes objects when the HashSet is adding a new object. Any help would be greatly appreciated!</p>