public static List <T> Get <T>(this DoRedisList input, string key) where T : class, new() { var data = input.Get(key); var result = new List <T>(); data.ForEach(item => { result.Add(StringToObject <T>(item)); }); return(result); }
public static void AddList <T>(this DoRedisList input, string key, List <T> entitys) where T : class, new() { List <string> list = new List <string>(); foreach (T entity in entitys) { string item = ConvertJson <T>(entity); list.Add(item); } input.Add(key, list); }
public static void RPush <T>(this DoRedisList input, string key, T entity) where T : class, new() { var item = ConvertJson <T>(entity); input.RPush(key, item); }