title: distinct records from a List of KeyValue pairs with caseinsensitive comparison
body: <p>Here is my list of KeyValuePairs</p>
  <pre><code>List&lt;KeyValuePair&lt;string,string&gt;&gt; kvpair =new List&lt;KeyValuePair&lt;string,string&gt;&gt;()
  sample data
  
      &quot;the brown fox&quot;, &quot;xy the brown fox....&quot;
      &quot;the brown Fox&quot;, &quot;xy the brown Fox....&quot;
      &quot;The brown Fox&quot;, &quot;xy the brown Fox....&quot;
      &quot;the brown fox&quot;, &quot;xy the brown fox....&quot;
      &quot;the brown fox&quot;, &quot;xy the brown fox....&quot;
      &quot;The black fox&quot;, &quot;xy The black fox....&quot;
  </code></pre>
  <p>As you can see there are too many duplicate records in the list. How can I skip all duplicates and get kvpair with only distict keys along with its corresponding value from the list. My expected result should contain only two records
  (ie., expected result should be as follows</p>
  <pre><code>&quot;the brown Fox&quot;, &quot;xy the brown Fox....&quot;  
  &quot;The black fox&quot;, &quot;xy The black fox....&quot;
  </code></pre>
  <p>)</p>
  <p>I tried this, but not working as expected</p>
  <pre><code>var distinctKvPair=kvPair.Where(g =&gt; g.Key.Contains(g.Key, StringComparison.OrdinalIgnoreCase)).GroupBy(g=&gt;g.Key) as List&lt;KeyValuePair&lt;string, string&gt;&gt;
  </code></pre>