public async Task <ActionResult> Update(int id, CommentRequest commentRequest) { var updateCommentCommand = new UpdateCommentCommand { Id = id, Content = commentRequest.Content }; await Mediator.Send(updateCommentCommand); return(NoContent()); }
public async Task <ActionResult> Create(int postId, CommentRequest commentRequest) { var addCommentCommand = new AddCommentCommand { Content = commentRequest.Content, PostId = postId, UserId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value }; var createdCommentId = await Mediator.Send(addCommentCommand); return(StatusCode(201, createdCommentId)); }