title: Use LINQ ToDictionary with ConcurrentDictionary
body: <p>I'm using a dictionary to collect events in a multithread application, using lock when I add an event and not using it when I search for one.
  Every hour or so I run a cleanup of the events older than a certain time.
  Very simple and it works.</p>
  
  <p>I'd like to move to a ConcurrentDictionary to remove the locks, and I thought I just had to add "Concurrent" and change the Add to TryAdd.
  But then I incurred in the error that LINQ returns only ToDictionary.
  I can obviusly not use LINQ, but I was curios to know if there's something I can do to preserve it.
  And more important, is there something I else I should consider before moving to ConcurrentDictionry?</p>
  
  <pre><code>public class messageResult
          {
              public Result result;
              public DateTime receivedTime;
          }
  
  
  public Dictionary&lt;Guid, messageResult&gt; events = new Dictionary&lt;Guid, messageResult&gt;();
  
  
  lock (events)
              {
                  events = events.Where(p =&gt; p.Value.receivedTime &gt;= t).ToDictionary(p =&gt; p.Key, p =&gt; p.Value);
              }
  </code></pre>
  
  <p>Thanks</p>