Exemple #1
0
        public async Task <IActionResult> AddComment([FromBody] AddCommentDto commentDto)
        {
            var post = await _postsRepository.QueryAsync(commentDto.PostId);

            var comment = new Comment(post, commentDto.Comment);
            await _postsRepository.AddCommentAsync(post, comment);

            return(Ok(post));
        }