/// <summary>
 /// 获取键的集合
 /// </summary>
 /// <returns>键的集合</returns>
 private ICollection <string> GetCacheKeys()
 {
     lock (locker)
     {
         IEnumerable <KeyValuePair <string, object> > items = cache.AsEnumerable();
         return(items.Select(m => m.Key).ToList());
     }
 }
Пример #2
0
        public static List <string> Keys()
        {
            List <string> list = new List <string>();
            IEnumerable <KeyValuePair <string, object> > items = cache.AsEnumerable();

            foreach (KeyValuePair <string, object> item in items)
            {
                list.Add(item.Key);
            }
            return(list);
        }
Пример #3
0
        /// <summary>
        ///  Get Enumerator
        /// </summary>
        /// <returns></returns>

        public IEnumerator <KeyValuePair <string, object> > GetEnumerator()
        {
            return((IEnumerator <KeyValuePair <string, object> >)MemoryCache.AsEnumerable());
        }
Пример #4
0
 public IEnumerable <KeyValuePair <string, object> > GetEnumerable()
 {
     return(_Cache.AsEnumerable());
 }