title: Updating the key object in AddOrUpdate method
body: <p>I have a Test class.</p>
  
  <pre><code>class Test
  {
      public int Id { get; set; }
      public int Val { get; set; }
  }
  </code></pre>
  
  <p>I would like to setup a ConcurrentDictionary with an int as Key and Test as the value. </p>
  
  <pre><code>bool External = true;
  ConcurrentDictionary&lt;int, Test&gt; data = new ConcurrentDictionary&lt;int, Test&gt;();
  </code></pre>
  
  <p>I would like to write the Update part of AddorUpdate for this dictionary so that if an external variable (say External) is true then the Val for that instance of Test should increment by 100 but if bool is false then it should decrement by 100. Can someone help me how can I do it. I am just not sure  how can I get access to the Test instance in the dictionary using a lambda. Also can I have an  method call in spite of the lambda?</p>