ThreadSafeCacheOptionsBaseCreateInstanceTKey, TValue Method

Creates an IThreadSafeCacheAccessorTKey, TValue instance, whose settings are represented by this ThreadSafeCacheOptionsBase instance.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
protected abstract IThreadSafeCacheAccessor<TKey, TValue> CreateInstance<TKey, TValue>(
	Func<TKey, TValue> itemLoader,
	IEqualityComparer<TKey>? comparer
)

Parameters

itemLoader  FuncTKey, TValue
A delegate that is invoked when an item is not present in the cache.
comparer  IEqualityComparerTKey
An IEqualityComparerT instance to be used for comparing keys in the cache instance to create. When , a default comparer will be used.

Type Parameters

TKey
The type of the key in the cache.
TValue
The type of the value in the cache.

Return Value

IThreadSafeCacheAccessorTKey, TValue
An IThreadSafeCacheAccessorTKey, TValue instance, whose settings are represented by this ThreadSafeCacheOptionsBase instance.

See Also