예제 #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);
        }
예제 #2
0
        /// <summary>
        /// 移除key的value
        /// </summary>
        public static bool Remove(string key)
        {
            var result = new RedisOperatorBase().Remove(key);

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

            return(result);
        }
예제 #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);
        }
예제 #5
0
        /// <summary>
        /// 判断某个数据是否已经被缓存
        /// </summary>
        public static bool Exist <T>(string hashId, string key)
        {
            var result = new RedisOperatorBase().Redis.HashContainsEntry(hashId, key);

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

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

            return(result);
        }