KGy SOFT

CacheTKey, TValueRefreshValue Method

KGy SOFT Core Libraries Help
Refreshes the value of the key in the CacheTKey, TValue even if it already exists in the cache by using the item loader that was passed to the constructor.

Namespace:  KGySoft.Collections
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.0.0
Syntax

public void RefreshValue(
	TKey key
)

Parameters

key
Type: TKey
The key of the item to refresh.
Exceptions

ExceptionCondition
ArgumentNullExceptionkey is .
KeyNotFoundExceptionThe CacheTKey, TValue has been initialized without an item loader.
Remarks

The loaded value will be stored in the CacheTKey, TValue. If a value already existed in the cache for the given key, then the value will be replaced.

To get the refreshed value as well, use GetValueUncached(TKey) method instead.

The cost of this method depends on the cost of the item loader function that was passed to the constructor. Refreshing the already loaded value approaches an O(1) operation.

See Also

Reference