public ActionResult <Comment> Post(string postId, [FromBody] Comment comment)
 {
     return(_postService.CreateComment(postId, comment));
 }
示例#2
0
        public CommentReadDto CreateComment(int postId, [FromBody] CommentCreateDto dto)
        {
            var userId = GetUserIdFromToken();

            return(_postService.CreateComment(dto, postId, userId));
        }
示例#3
0
        public ActionResult <Post> Create(string postId, Comment comment)
        {
            Post result = _postService.CreateComment(postId, comment);

            return(CreatedAtRoute("GetPost", new { id = result.Id }, result));
        }