コード例 #1
0
        public async Task <CommentDto> UpdateAsync(Guid id, UpdateCommentInput input)
        {
            var comment = await CommentRepository.GetAsync(id);

            if (comment.CreatorId != CurrentUser.Id)
            {
                throw new BusinessException();
            }

            comment.SetText(input.Text);

            var updatedComment = await CommentRepository.UpdateAsync(comment);

            return(ObjectMapper.Map <Comment, CommentDto>(updatedComment));
        }
コード例 #2
0
 public Task <CommentDto> UpdateAsync(Guid id, UpdateCommentInput input)
 {
     return(CommentPublicAppService.UpdateAsync(id, input));
 }