KGy SOFT

CacheTKey, TValueGetValueUncached Method

KGy SOFT Core Libraries Help

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

public TValue GetValueUncached(
	TKey key
)

Parameters

key
Type: TKey
The key of the item to reload.

Return Value

Type: TValue
A TValue instance that was retrieved by the item loader that was used to initialize this CacheTKey, TValue instance.
Exceptions

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

To get a value from the CacheTKey, TValue, and using the item loader only when key does not exist in the cache, read the indexer property.

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.

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

See Also

Reference