title: c# List<Dictionary<string,string>> add unique dictionaries
body: <p>I have a list of dictionary:</p>
  
  <pre><code>List&lt;Dictionary&lt;string, string&gt;&gt; items = new List&lt;Dictionary&lt;string, string&gt;&gt;();
  
  foreach (var group in groupedItems)
  {
  
      foreach (var item in group)
      {
           Dictionary&lt;string, string&gt; newItem = new Dictionary&lt;string, string&gt;();
           newItem.Add("name", item.Name);
           newItem.Add("value", item.Value);
      }
   }
  
  items.Add(newItem);
  </code></pre>
  
  <p>Basically when I loop through the grouped items, I create a Dictionary where the key is the item.Name and value is item.Value. In a grouped case, this will result in duplicate dictionaries to the list.</p>
  
  <p>How can I avoid adding duplicate Dictionary to this List?</p>
  
  <p>I have a foreach loop and I want to add some items once.</p>