public virtual async Task <CommentDto> UpdateAsync(Guid id, UpdateCommentInput input) { var comment = await CommentRepository.GetAsync(id); if (comment.CreatorId != CurrentUser.GetId()) { throw new BusinessException(); } comment.SetText(input.Text); var updatedComment = await CommentRepository.UpdateAsync(comment); return(ObjectMapper.Map <Comment, CommentDto>(updatedComment)); }
public virtual async Task <CommentDto> UpdateAsync(Guid id, UpdateCommentInput input) { var comment = await CommentRepository.GetAsync(id); if (comment.CreatorId != CurrentUser.GetId()) { throw new AbpAuthorizationException(); } comment.SetText(input.Text); comment.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); var updatedComment = await CommentRepository.UpdateAsync(comment); return(ObjectMapper.Map <Comment, CommentDto>(updatedComment)); }
public Task <CommentDto> UpdateAsync(Guid id, UpdateCommentInput input) { return(CommentPublicAppService.UpdateAsync(id, input)); }