ICacheApiSetT(String, T, TimeSpan) Method
|
Inserts a cache entry into the cache by using a key and a value and specifies time-based expiration details.
Namespace: Casewhere.Runtime.DSL.ApiAssembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.5.0
Syntaxvoid Set<T>(
string key,
T value,
TimeSpan timeExpiration
)
Parameters
- key String
- The key.
- value T
- The value.
- timeExpiration TimeSpan
- The expiration time.
Type Parameters
- T
- Type of the cached object.
RemarksIf the specified entry does not exist, it is created. If the specified entry exists, it is updated.
Examplevar cacheApi = ctx.Use<ICacheApi>();
cacheApi.Set("cache_key", "cache_value", new System.TimeSpan(30));
See Also