Example #1
0
        public static bool SetEntryInHash <T>(this DoRedisHash input, string hashid, string key, T entity) where T : class, new()
        {
            string item   = ConvertJson <T>(entity);
            bool   result = input.SetEntryInHash(hashid, key, item);

            return(result);
        }
Example #2
0
        public static List <T> GetHashValues <T>(this DoRedisHash input, string hashid) where T : class, new()
        {
            List <T>      list   = new List <T>();
            List <string> values = input.GetHashValues(hashid);

            foreach (string value in values)
            {
                T obj = StringToObject <T>(value);
                list.Add(obj);
            }
            return(list);
        }
Example #3
0
        public static T GetValueFromHash <T>(this DoRedisHash input, string hashid, string key) where T : class, new()
        {
            string item = input.GetValueFromHash(hashid, key);

            if (string.IsNullOrEmpty(item))
            {
                return(null);
            }
            T obj = StringToObject <T>(item);

            return(obj);
        }