Example #1
0
        /// <summary>
        /// 删除回复需要更新Comment上的回复总数,需要CommentId
        /// </summary>
        /// <param name="replyId"></param>
        /// <param name="commentId"></param>
        public void deleteCommentReply(long replyId, long commentId)
        {
            var r = _praizeRepository.Db.Ado.UseTran(() =>
            {
                //物理删除点赞
                _praizeRepository.DeletePraized_CommentReply_Res(replyId, null);

                //删除回复
                if (_commentReplyResRepository.DeleteByKey_Sync(replyId))
                {
                    _commentResRepository.UpdateComment_ReplyNum(commentId, OperationDirection.minus, 1);
                }
            });

            if (!r.IsSuccess)
            {
                throw new Exception(r.ErrorMessage);
            }
        }