Method AddOrUpdate
AddOrUpdate<TValue, TKey>(ISourceCache<TValue, TKey>, TKey, Func<TValue>, Func<TKey, TValue, TValue>)
Declaration
public static TValue AddOrUpdate<TValue, TKey>(this ISourceCache<TValue, TKey> instance, TKey key, Func<TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
Parameters
Type |
Name |
Description |
ISourceCache<TValue, TKey> |
instance |
|
TKey |
key |
|
Func<TValue> |
addValueFactory |
|
Func<TKey, TValue, TValue> |
updateValueFactory |
|
Returns
Type Parameters
Name |
Description |
TValue |
|
TKey |
|
AddOrUpdate<TValue, TKey>(ISourceCache<TValue, TKey>, TKey, Func<TKey, TValue>, Func<TKey, TValue, TValue>)
Declaration
public static TValue AddOrUpdate<TValue, TKey>(this ISourceCache<TValue, TKey> instance, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
Parameters
Type |
Name |
Description |
ISourceCache<TValue, TKey> |
instance |
|
TKey |
key |
|
Func<TKey, TValue> |
addValueFactory |
|
Func<TKey, TValue, TValue> |
updateValueFactory |
|
Returns
Type Parameters
Name |
Description |
TValue |
|
TKey |
|