Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }