ICache ApiSetT(String, T, Time Span) Method
Inserts a cache entry into the cache by using a key and a value and specifies time-based expiration details.
Definition
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
void Set<T>(
string key,
T value,
TimeSpan timeExpiration
)
Parameters
Type Parameters
- T
- Type of the cached object.
Remarks
If the specified entry does not exist, it is created. If the specified entry exists, it is updated.
Example
C#
var cacheApi = ctx.Use<ICacheApi>();
cacheApi.Set("cache_key", "cache_value", new System.TimeSpan(30));