예제 #1
0
        /// <summary>
        /// exist value by key
        /// </summary>
        /// <param name="KeyName"></param>
        /// <returns></returns>
        public Boolean ExistKey(String KeyName, String Field)
        {
            if (conn == null)
            {
                throw new Exception("Connection has not initialize.");
            }

            return(conn.HExists(KeyName, Field));
        }
 public bool TryGetValue(string key, out byte[] value)
 {
     if (redisDB.HExists(this.Id, key))
     {
         value = redisDB.HGet <byte[]>(this.Id, key);
         redisDB.ExpireAsync(this.Id, config.ExpireSeconds);
         return(true);
     }
     else
     {
         value = null;
         return(false);
     }
 }
예제 #3
0
 /// <summary>
 /// 判断某个数据是否已经被缓存
 /// </summary>
 /// <param name="key"></param>
 /// <param name="dataKey"></param>
 /// <returns></returns>
 public bool Exists(string key, string dataKey)
 {
     return(csredis.HExists(key, dataKey));
 }