- bool TryRemove(TKey key)
This method can be used when you don't care about the value that is removed.
- TValue GetOrDefault(TKey key)
Useful when you want to use the types default value if the key is not in the dictionary.
- TValue AddOrUpdate(TKey key, TValue value)
When the value is already known and you don't want to use the Func parameter.
- TValue GetOrAdd(TKey key, Func<TValue> valueFactory)
When the valueFactory functions execution does not depend on the key.
- int RemoveConditional(Predicate<TValue> condition)
This method removes all key value pairs where the value meets a condition and returns the count of removed items. Warning: This method is not thread-safe. If one thread changes the value between the check of the condition and removal, the key is still removed.
Click here to download