public void ClearRegion(string region)
        {
            var keys = RedisServer.Keys(0, region);

            foreach (var key in keys)
            {
                CacheManager.Remove(key);
            }
        }
示例#2
0
        public bool RemovePattern(string patternKey)
        {
            IEnumerable <RedisKey> keys = RedisServer.Keys(pattern: $"{patternKey}*", pageSize: 5000); // I am not sure the use of pageSize here.

            foreach (var item in keys)
            {
                Remove(item);
            }
            return(true);
        }
示例#3
0
 public Dictionary <string, object> GetAll()
 {
     lock (RedisDataBase)
     {
         lock (RedisServer)
         {
             var dictionary = new Dictionary <string, object>();
             foreach (var item in RedisServer.Keys())
             {
                 dictionary.Add(item, RedisDataBase.StringGet(item));
             }
             return(dictionary);
         }
     }
 }
        public bool ContainsKeysFind(string region)
        {
            var keys = RedisServer.Keys(0, region);

            return(keys.Any());
        }