コード例 #1
0
        public async Task <IActionResult> UpdateComment([FromBody] UpdateCommentVm model)
        {
            model.UserId = this.CurrentUserId.Value;
            await _commentsService.UpdateComment(model);

            return(this.Ok());
        }
コード例 #2
0
ファイル: CommentsService.cs プロジェクト: StasVitAlex/Video
 public async Task UpdateComment(UpdateCommentVm model)
 {
     if (!await _commentsRepository.UserIsCommentOwner(model.UserId, model.Id))
     {
         throw new AccessDeniedException();
     }
     await _commentsRepository.UpdateComment(_mapper.Map <UpdateCommentDto>(model));
 }