title: How to prevent duplicate values in a dictionary in c# .net
body: <p>I have dictionary where values are duplicating. How to prevent duplicates in dictionary? Following is my code</p>
  
  <pre><code>private class GcellGtrx
  {
      public Gcell Gcell { get; set; }
      public Gtrx Gtrx { get; set; }
  }
      private readonly Dictionary&lt;int, GcellGtrx&gt; _dictionary = new Dictionary&lt;int, GcellGtrx&gt;();
  
  _dictionary.Add(gcell.CellId, gcellGtrx);
  </code></pre>