title: Copy key values from NameValueCollection to Generic Dictionary
body: <p>Trying to copy values from an existing NameValueCollection object to a Dictionary. I have the following code below to do that but seems the Add does not accept that my keys and values are as Strings </p>
  
  <pre><code>IDictionary&lt;TKey, TValue&gt; dict = new Dictionary&lt;TKey, TValue&gt;();
  public void copyFromNameValueCollection (NameValueCollection a)
  {
      foreach (var k in a.AllKeys)
      { 
          dict.Add(k, a[k]);
      }  
  }
  </code></pre>
  
  <p><strong>Note:</strong> NameValueCollection contains String keys and values and so I simply want to provide here a method to allow copying of those to a <strong>generic</strong> dictionary.</p>