title: What to add for the update portion in ConcurrentDictionary AddOrUpdate
body: <p>I am trying to re-write some code using Dictionary to use ConcurrentDictionary. I have reviewed some examples but I am still having trouble implementing the AddOrUpdate function. This is the original code:</p>
  
  <pre><code>    dynamic a = HttpContext;
      Dictionary&lt;int, string&gt; userDic = this.HttpContext.Application["UserSessionList"] as Dictionary&lt;int, String&gt;;
  
     if (userDic != null)
     {
        if (useDic.ContainsKey(authUser.UserId))
        {
          userDic.Remove(authUser.UserId);
        }
     }
    else
    {
       userDic = new Dictionary&lt;int,string&gt;();
    }
    userDic.Add(authUser.UserId, a.Session.SessionID.ToString());
    this.HttpContext.Application["UserDic"] = userDic;
  </code></pre>
  
  <p>I don't know what to add for the update portion:</p>
  
  <pre><code>userDic.AddOrUpdate(authUser.UserId,
                      a.Session.SessionID.ToString(),
                      /*** what to add here? ***/);
  </code></pre>
  
  <p>Any pointers would be appreciated.</p>