public List <T> GetValuesByIds <T>(List <string> ids, bool needKeyFormat = false) { using (var Redis = RedisClientManager.GetReadOnlyClient()) { List <T> results = new List <T>(); if (needKeyFormat) { for (int i = 0; i < ids.Count; i++) { ids[i] = RedisKeyFactory.ModelKey <T>(ids[i]); } results = Redis.GetValues <T>(ids); } else { results = Redis.GetValues <T>(ids); } return(results == null ? new List <T>() : results); } }
private string GetKey <T>(string id) { return(RedisKeyFactory.ModelKey <T>(id)); }
protected string GetKey <T>(T model) where T : IRedisModelBase { return(RedisKeyFactory.ModelKey <T>(model.Id)); }