public void ClearRegion(string region) { var keys = RedisServer.Keys(0, region); foreach (var key in keys) { CacheManager.Remove(key); } }
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); }
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()); }