public async Task <IActionResult> GetComments(int gameId) { if (await _repo.GetGame(gameId) == null) { return(NotFound()); } var comments = await _repo.GetComments(gameId); return(Ok(comments)); }
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)); }