Method AddOrUpdate
AddOrUpdate<TKey, TValue>(IDictionary<TKey, TValue>, TKey, Func<TValue>)
Declaration
public static TValue AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TValue> newValueFactory)
Parameters
Type |
Name |
Description |
IDictionary<TKey, TValue> |
dictionary |
|
TKey |
key |
|
Func<TValue> |
newValueFactory |
|
Returns
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
AddOrUpdate<TKey, TValue>(IDictionary<TKey, TValue>, TKey, Func<TValue>, Func<TKey, TValue, TValue>)
Declaration
public static TValue AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TValue> newValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
Parameters
Type |
Name |
Description |
IDictionary<TKey, TValue> |
dictionary |
|
TKey |
key |
|
Func<TValue> |
newValueFactory |
|
Func<TKey, TValue, TValue> |
updateValueFactory |
|
Returns
Type Parameters
Name |
Description |
TKey |
|
TValue |
|