public PagedResponse <PostCommentDto, Comment> Execute(PostCommentRepliesSearch search) { if (_context.Posts.Find(search.PostId) == null) { throw new EntityNotFoundException(search.PostId, typeof(Post)); } var query = _context.Comments .Include(c => c.ChildComments) .Where(c => c.PostId == search.PostId && c.ParentId == search.CommentId).AsQueryable(); return(new PagedResponse <PostCommentDto, Comment>(query, search, _mapper)); }
public IActionResult GetRepliesForComment(int id, int commentId, [FromQuery] PostCommentRepliesSearch search, [FromServices] IGetPostCommentRepliesQuery query) { search.PostId = id; search.CommentId = commentId; return(Ok(_executor.ExecuteQuery(query, search))); }