I am trying to update entries in a ConcurrentDictionary something like this:
class Class1 { public int Counter { get; set; } } class Test { private
You can use the AddOrUpdate function.
Here is how you can increment the current value by 1:
dict.AddOrUpdate(key, 1, (key, oldValue) => oldValue + 1);