ICacheApiGetT Method

Returns an entry from the cache.

Definition

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

Parameters

key  String
The key.

Type Parameters

T
Type of the cached object.

Return Value

T
A reference to the cache entry that is identified by key, if the entry exists; otherwise, It will throw an exception.

Example

C#
                    var cacheApi = ctx.Use<ICacheApi>();
var entryValue = cacheApi.Get<object>("cache_key");
                  

Exceptions

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.

See Also