Ejemplo n.º 1
0
 /// <summary>
 /// Get a value indicating whether the value associated with the specified key is cached
 /// </summary>
 /// <param name="key">Key of cached item</param>
 /// <returns>True if item already is in cache; otherwise false</returns>
 public bool IsSet(CacheKey key)
 {
     return(_memoryCache.TryGetValue(key.Key, out _));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Remove the value with the specified key from the cache
 /// </summary>
 /// <param name="cacheKey">Cache key</param>
 /// <param name="cacheKeyParameters">Parameters to create cache key</param>
 public void Remove(CacheKey cacheKey, params object[] cacheKeyParameters)
 {
     cacheKey = PrepareKey(cacheKey, cacheKeyParameters);
     _memoryCache.Remove(cacheKey.Key);
 }