public virtual void RemoveByPrefix(string prefix)
        {
            foreach (var endPoint in _connectionWrapper.GetEndPoints())
            {
                var keys = GetKeys(endPoint, prefix);

                _db.KeyDelete(keys.ToArray());
            }
        }
예제 #2
0
        protected virtual async Task RemoveByPatternAsync(string pattern)
        {
            foreach (var endPoint in _connectionWrapper.GetEndPoints())
            {
                var server = _connectionWrapper.GetServer(endPoint);
                var keys   = server.Keys(database: _db.Database, pattern: $"*{pattern}*");

                await _db.KeyDeleteAsync(keys.ToArray());
            }
        }
예제 #3
0
 /// <summary>
 /// Removes items by key pattern
 /// </summary>
 /// <param name="pattern">String key pattern</param>
 public virtual void RemoveByPattern(string pattern)
 {
     foreach (var endPoint in _connectionWrapper.GetEndPoints())
     {
         var server = _connectionWrapper.GetServer(endPoint);
         var keys = server.Keys(database: _db.Database, pattern: $"*{pattern}*");
         foreach (var key in keys)
             Remove(key);
     }
 }
예제 #4
0
        /// <summary>
        /// Removes items by key pattern
        /// </summary>
        /// <param name="pattern">String key pattern</param>
        public virtual void RemoveByPattern(string pattern)
        {
            _perRequestCacheManager.RemoveByPattern(pattern);

            foreach (var endPoint in _connectionWrapper.GetEndPoints())
            {
                var keys = GetKeys(endPoint, pattern);

                _db.KeyDelete(keys.ToArray());
            }
        }
 /// <summary>
 /// Removes items by pattern
 /// </summary>
 /// <param name="pattern">pattern</param>
 public void RemoveByPattern(string pattern)
 {
     foreach (var ep in _connectionWrapper.GetEndPoints())
     {
         var server = _connectionWrapper.GetServer(ep);
         var keys   = server.Keys(database: _db.Database, pattern: "*" + pattern + "*");
         foreach (var key in keys)
         {
             Remove(key);
         }
     }
 }
예제 #6
0
 public virtual void KalıpİleSil(string pattern)
 {
     foreach (var ep in _connectionWrapper.GetEndPoints())
     {
         var server = _connectionWrapper.GetServer(ep);
         var keys   = server.Keys(database: _db.Database, pattern: "*" + pattern + "*");
         foreach (var key in keys)
         {
             Sil(key);
         }
     }
 }
예제 #7
0
        /// <summary>
        /// 通过正则表达式移除数据
        /// </summary>
        /// <param name="pattern"></param>
        /// <returns></returns>
        protected virtual async Task RemoveByPatternAsync(string pattern)
        {
            _perRequestCacheManager.RemoveByPattern(pattern);
            foreach (var endPoint in _connectionWrapper.GetEndPoints())
            {
                var server = _connectionWrapper.GetServer(endPoint);
                var keys   = server.Keys(database: _db.Database, pattern: $"*{pattern}*");

                //始终保留保护key的数据
                keys = keys.Where(key => !key.ToString().Equals(OarmsCachingDefaults.RedisDataProtectionKey, StringComparison.OrdinalIgnoreCase));

                await _db.KeyDeleteAsync(keys.ToArray());
            }
        }
예제 #8
0
 public virtual void RemoveByPattern(string pattern)
 {
     foreach (var ep in _connectionWrapper.GetEndPoints())
     {
         var server = _connectionWrapper.GetServer(ep);
         var keys   = server.Keys(database: _db.Database, pattern: "*" + pattern + "*");
         foreach (var key in keys)
         {
             //Remove(KeyHp.GetCacheKey(key));
             // Remove(key);
             DirectRemoveKey(key);
         }
     }
 }
예제 #9
0
        /// <summary>
        /// Removes items by key pattern
        /// </summary>
        /// <param name="pattern">String key pattern</param>
        protected virtual async Task RemoveByPatternAsync(string pattern)
        {
            _perRequestCacheManager.RemoveByPattern(pattern);

            foreach (var endPoint in _connectionWrapper.GetEndPoints())
            {
                var server = _connectionWrapper.GetServer(endPoint);
                var keys   = server.Keys(database: _db.Database, pattern: $"*{pattern}*");

                //we should always persist the data protection key list
                keys = keys.Where(key => !key.ToString().Equals(RedisConfiguration.DataProtectionKeysName, StringComparison.OrdinalIgnoreCase));

                await _db.KeyDeleteAsync(keys.ToArray());
            }
        }
예제 #10
0
        /// <summary>
        /// Removes items by key pattern
        /// </summary>
        /// <param name="pattern">String key pattern</param>
        protected virtual async Task RemoveByPatternAsync(string pattern)
        {
            _perRequestCacheManager.RemoveByPattern(pattern);

            foreach (System.Net.EndPoint endPoint in _connectionWrapper.GetEndPoints())
            {
                IServer server = _connectionWrapper.GetServer(endPoint);
                System.Collections.Generic.IEnumerable <RedisKey> keys = server.Keys(database: _db.Database, pattern: $"*{pattern}*");

                //we should always persist the data protection key list
                keys = keys.Where(key => !key.ToString().Equals(NopCachingDefaults.RedisDataProtectionKey, StringComparison.OrdinalIgnoreCase));

                await _db.KeyDeleteAsync(keys.ToArray());
            }
        }