title: C# Update a Dictionary<string,string> with LINQ Query
body: <p>I am trying to update my program settings, which are stored in a Dictionary.  Strangely enough if they were stored in a DatabaseContext the following function would work (I think), but since they are in a Dictionary I am getting a compiler error.  Why is my KeyValuePair.Value read only?  More importantly, how can I re-write the following function to actually update the Dictionary?</p>
  
  <p>Thanks </p>
  
  <pre><code>public void putSetting(Dictionary&lt;string, string&gt; settings, string setting, string value)
  {
    var qry = (from s in settings
               where s.Key == setting
               select s).Single();
     qry.Value = value; // Error  1 Property or indexer 
                        // 'System.Collections.Generic.KeyValuePair&lt;string,string&gt;.Value'
                        // cannot be assigned to -- it is read only
  }
  </code></pre>