/// <summary>Remove todas as chaves no redis</summary> /// <param name="cacheService">Serviço de cache</param> /// <param name="pattern">Padrão de nome das chaves a serem removidas</param> public static Task <long> RemoveAllByPatternAsync(this IResponseCacheService cacheService, string pattern) { var keys = cacheService.GetKeysByPattern(pattern, int.MaxValue); return(cacheService.RemoveCachedResponseByNamesAsync(keys.ToArray())); }
/// <summary>Obtém todas a chaves do redis paginadas</summary> /// <param name="cacheService">Serviço de cache</param> /// <param name="pageSize">Tamanho da página</param> /// <param name="pageOffset">Indice da página</param> public static IEnumerable <string> GetAllKeys( this IResponseCacheService cacheService, int pageSize = 250, int pageOffset = 0 ) => cacheService.GetKeysByPattern("*", pageSize, pageOffset);