public async Task SearchKeys() { using (TCacheService cache = new TCacheService(TestConfiguration.EnvRedisUri)) { await cache.SetObjectAsKeyValue("user:test1:1", "test"); await cache.SetObjectAsKeyValue("user:test1:2", "test"); await cache.SetObjectAsKeyValue("user:test1:3", "test"); await cache.SetObjectAsKeyValue("user:test1:4", "test"); List <string> results = await cache.SearchKeys("user:test1*"); Assert.Equal(4, results.Count); foreach (var item in results) { await cache.RemoveKey(item); } } }
public async Task <List <string> > SearchKeys(string searchTerm) { return(await _cacheService.SearchKeys(searchTerm)); }