Class IDictionaryExtensions
- Namespace
- PAC.Extensions.System.Collections
Extension methods for IDictionary<TKey, TValue>.
public static class IDictionaryExtensions
- Inheritance
-
IDictionaryExtensions
- Inherited Members
Methods
GetOrAdd<TKey, TValue>(IDictionary<TKey, TValue>, TKey, TValue)
If the IDictionary already contains the key, it will return the existing value associated with it. If the key is not present, it will add it with the given value and return that value.
public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dict, TKey key, TValue value)
Parameters
dict
IDictionary<TKey, TValue>key
TKeyvalue
TValue
Returns
- TValue
Type Parameters
TKey
TValue