ICache ApiTry GetT Method
Get item from cached if return true, otherwise it returns false
Definition
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
True if the key is found in the cache; otherwise, False.
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
bool TryGet<T>(
string key,
out T data
)
Parameters
- key String
- The key.
- data T
- The cached data object.
Type Parameters
- T
- Type of the cached object.
Return Value
BooleanTrue if the key is found in the cache; otherwise, False.
Example
C#
var cacheApi = ctx.Use<ICacheApi>();
var hasValue = cacheApi.TryGet<object>("cache_key", out object returnObject);