Exemplo n.º 1
0
        /// <summary>
        /// 存储数据到hash表
        /// </summary>
        public static bool Set <T>(string hashId, string key, T t, DateTime tmpExpire)
        {
            var result = new RedisOperatorBase().Set(key, t);

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 移除hash中的某值
        /// </summary>
        public static bool Remove(string hashId, string key)
        {
            var result = new RedisOperatorBase().Remove(hashId, key);

            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 存储数据到hash表
        /// </summary>
        public static bool Set <T>(string key, T t)
        {
            var result = new RedisOperatorBase().Set <T>(key, t);

            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 存储数据到hash表
        /// </summary>
        public static bool Set(string key, string value, DateTime tmpExpire)
        {
            var result = new RedisOperatorBase().Set(key, value, tmpExpire);

            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 判断某个数据是否已经被缓存
        /// </summary>
        public static bool Exist <T>(string hashId, string key)
        {
            var result = new RedisOperatorBase().Redis.HashContainsEntry(hashId, key);

            return(result);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 判断某个数据是否已经被缓存
        /// </summary>
        public static bool Exist(string key)
        {
            var result = new RedisOperatorBase().Redis.ContainsKey(key);

            return(result);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 存取任意类型的值(hashId与key相同)
        /// </summary>
        public static T Get <T>(string key)
        {
            var result = new RedisOperatorBase().Get <T>(key);

            return(result);
        }