I have a dictionary of
IDictionary<TKey, long> dictionary;
Instead of using https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.collectionextensions.getvalueordefault?view=net-6.0 to add values to the list like so:
dictionary[key] = dictionary.GetValueOrDefault(key) + value;
I would like to just do:
dictionary[key] += value;
Is there a way to override or subclass or wrap dictionary to do this correctly?