Exemplo n.º 1
0
        public async Task <IActionResult> GetComments(int gameId)
        {
            if (await _repo.GetGame(gameId) == null)
            {
                return(NotFound());
            }

            var comments = await _repo.GetComments(gameId);

            return(Ok(comments));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetComments(int gameId, [FromQuery] CommentParams commentParams)
        {
            if (await _repo.GetGame(gameId) == null)
            {
                return(NotFound());
            }

            var comments = await _repo.GetComments(gameId, commentParams);

            Response.AddPagination(comments.CurrentPage, comments.PageSize, comments.TotalCount, comments.TotalPages);

            return(Ok(comments));
        }