Esempio n. 1
0
        /// <summary>
        /// delete value by key
        /// </summary>
        /// <param name="KeyName"></param>
        /// <param name="Field"></param>
        /// <returns></returns>
        public Int32 DeleteHashValue(String KeyName, String[] Field)
        {
            if (conn == null)
            {
                throw new Exception("Connection has not initialize.");
            }

            return((int)conn.HDel(KeyName, Field));
        }
Esempio n. 2
0
 /// <summary>
 /// 根据表名,键名,删除hash值
 /// </summary>
 /// <param name="key">表名</param>
 /// <param name="field">键名</param>
 /// <returns></returns>
 public static long DeleteHash(string key, string field)
 {
     try
     {
         return(_redisManager.HDel(key, field));
     }
     catch (Exception)
     {
         return(0);
     }
 }
 public void Remove(string key)
 {
     redisDB.HDel(this.Id, key);
 }
 /// <summary>
 /// 删除一个或多个哈希表字段
 /// </summary>
 public int HashDel(string key, params string[] fields)
 {
     return((int)_redisClient.HDel(key, fields));
 }
Esempio n. 5
0
 /// <summary>
 /// 移除hash中的某值
 /// </summary>
 /// <param name="key"></param>
 /// <param name="dataKey"></param>
 /// <returns></returns>
 public bool HashDelete(string key, string dataKey)
 {
     return(csredis.HDel(key, dataKey) > 0);
 }