Table of Contents

Set Method

Definition

Namespace
Cuemon.Runtime.Caching
Assemblies
Cuemon.Runtime.Caching.dll
Source
src/Cuemon.Runtime.Caching/SlimMemoryCache.cs

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

key string

The unique identifier of the cache.

value object

The stored value of the cache.

invalidation CacheInvalidation

The object that contains expiration details for a specific cache entry.

ns string

The 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

key cannot be null -or- invalidation cannot be null.