public RedisAppReviewEvidence updateStatus(string userPhone, string status) { using (var redis = new ann_shop_redis()) { var byteEvidence = redis.HGet( APP_REVIEW_EVIDENCE, _convertToByte(userPhone) ); if (byteEvidence != null) { var evidence = JsonConvert.DeserializeObject <RedisAppReviewEvidence>(_convertToString(byteEvidence)); evidence.status = status; redis.HSet( APP_REVIEW_EVIDENCE, _convertToByte(evidence.userPhone), _convertToByte(JsonConvert.SerializeObject(evidence)) ); return(evidence); } return(null); } }
/// <summary> /// Khởi tạo thông tin review app của khách hàng /// </summary> /// <param name="evidence"></param> /// <returns></returns> public RedisAppReviewEvidence set(RedisAppReviewEvidence evidence) { using (var redis = new ann_shop_redis()) { redis.HSet( APP_REVIEW_EVIDENCE, _convertToByte(evidence.userPhone), _convertToByte(JsonConvert.SerializeObject(evidence)) ); return(evidence); } }