public async Task AddComment(AddCommentBlogViewModel newComment, int postId) { var comment = new Comment(); comment.Content = newComment.Content; comment.UserId = newComment.UserId; comment.PostId = postId; await _commentsRepository.Add(comment); }
public async Task <List <GetAllCommentsBlogViewItem> > AddComment([FromBody] AddCommentBlogViewModel newComment, int postId) { await _commentService.AddComment(newComment, postId); return(await _postService.ShowComments(postId)); }