IObjectCacheTKey, TValueGetOrInsert Method

Gets and returns the object if it exists in the cache otherwise the supplied createMethod is used to get the item from the repository

Definition

Namespace: Scanjour.Workflow4.Base.Cache
Assembly: Scanjour.Workflow4.Base (in Scanjour.Workflow4.Base.dll) Version: 24.4.0.0 (24.4.0.0)
C#
TValue GetOrInsert(
	Uri uri,
	TKey key,
	Func<TKey, TValue> createMethod
)

Parameters

uri  Uri
uri identifing the database
key  TKey
The key of the item to get
createMethod  FuncTKey, TValue
Function that is able to create a cacheitem

Return Value

TValue
The object identified by the key

See Also