Click or drag to resize

ICacheApiGetT Method

Returns an entry from the cache.

Namespace:  Casewhere.Runtime.DSL.Api
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
T Get<T>(
	string key
)

Parameters

key
Type: SystemString
The key.

Type Parameters

T
Type of the cached object.

Return Value

Type: T
A reference to the cache entry that is identified by key, if the entry exists; otherwise, It will throw an exception.
Exceptions
ExceptionCondition
NotFoundException The exception is thrown when the cache system not contains the cached object with the key
InvalidCastOperationException The exception is thrown when the cached object can't be cast to an specified type by generic type T.
Examples
var cacheApi = ctx.Use<ICacheApi>();
var entryValue = cacheApi.Get<object>("cache_key");
See Also