コード例 #1
0
        public async Task <OrderCommentDTO> UpdateOrderComment(OrderCommentToUpdateDTO commentToUpdate)
        {
            var comment = await _commentRepo.GetOrderCommentByIdAsync(commentToUpdate.CommentId);

            comment.Message = commentToUpdate.Message;

            return(ConvertOrderComment(await _genericRepo.UpdateAsync(comment)));
        }
コード例 #2
0
        public async Task <IActionResult> Post(OrderCommentToUpdateDTO comment)
        {
            comment.Message = _javaScriptEncoder.Encode(_htmlEncoder.Encode(comment.Message));

            if (await _commentServices.GetOrderCommentById(comment.CommentId) == null)
            {
                return(StatusCode(400, "Comment with id " + comment.CommentId + " was not found."));
            }
            await _commentServices.UpdateOrderComment(comment);

            return(StatusCode(200));
        }