Modify Dictionary Value is possible.What is the right approach?
<p>I have dictionary that is populated and I have no control of.</p>

<p>I need to modify the value how can I do that?</p>

<p>I have put a noddy example together to explain the problem</p>

<pre><code>class Program
{
    static void Main(string[] args)
    {


        Dictionary&lt;Customer, int&gt; CustomerOrderDictionary = new Dictionary&lt;Customer, int&gt;();

        CustomerOrderDictionary.Add(new Customer { Id = 1, FullName = "Jo Bloogs" },3);

        CustomerOrderDictionary.Add(new Customer { Id = 2, FullName = "Rob Smith" },5);

        //now I decide to increase the quantity but cannot do the below as value has no setter

        foreach (var pair in CustomerOrderDictionary)
        {
            if(pair.Key.Id==1)
            {
                pair.Value = 4;///ERROR HERE
            }
        }
    }
}


public class Customer
{
    public int Id { get; set; }
    public string FullName { get; set; }
}
</code></pre>

<p>Any suggestions?
Thanks a lot</p>
