When do we use HashSet<>
<p>i have a small sample .</p>

<pre><code>//Class
public class GetEntity
 {
   public string name1 { get; set; }
   public string name2 { get; set; }
   public GetEntity() { }
 }
</code></pre>

<p>and:</p>

<pre><code>public void GetHash()
   {
     HashSet objHash = new HashSet();
     GetEntity obj = new GetEntity();
     obj.name1 = "Ram";
     obj.name2 = "Shyam";
     objHash.Add(obj);
     foreach (GetEntity objEntity in objHash)
      {
        Label2.Text = objEntity.name1.ToString() + objEntity.name2.ToString();
      }

   }
</code></pre>

<p>Code works fine.Same task is done through Dictionary and List.But i want to know when we use HashSet&lt;> , Dictionary&lt;> or List&lt;>.Is there only performance issue or any other things which i dont understand.Thanks.</p>
