Exemple #1
0
        public override List <string> GetKeys(Func <string, bool> predicate = null)
        {
            var keys = _memoryCache.AsEnumerable().Select(t => t.Key);

            if (predicate == null)
            {
                return(keys.ToList());
            }
            else
            {
                return(keys.Where(predicate).ToList());
            }
        }
Exemple #2
0
 /// <summary>
 ///     获取全部的缓存项。
 /// </summary>
 /// <returns>全部的缓存项。</returns>
 public virtual IEnumerable <KeyValuePair <string, object> > GetAll()
 {
     return(_cache.AsEnumerable());
 }