Set Method
Definition
- Assemblies
- Cuemon.Runtime.Caching.dll
Set(string, object, CacheInvalidation, string)
Inserts a cache entry into the cache.
public void Set(string key, object value, CacheInvalidation invalidation, string ns = null)
Parameters
keystringThe unique identifier of the cache.
valueobjectThe stored value of the cache.
invalidationCacheInvalidationThe object that contains expiration details for a specific cache entry.
nsstringThe optional namespace that provides a scope to the cache.
Remarks
The Set(string, object, CacheInvalidation, string) method always puts a cache value in the cache, regardless whether an entry already exists with the same key. If the specified entry does not exist in the cache, a new cache entry is inserted. If the specified entry exists, its value is updated.
Exceptions
- ArgumentNullException
keycannot be null -or-invalidationcannot be null.