public IActionResult GetAssignmentComments([FromRoute] int assignmentId, [FromQuery] AssignmentCommentQuery commentQuery) { return(this.Ok(() => { IEnumerable <AssignmentCommentDTO> data = _AssignmentRepo.GetAllAssignmentComments(assignmentId, commentQuery); var query = new { PageSize = commentQuery.PageSize <= 0 ? 50 : commentQuery.PageSize, Page = commentQuery.Page <= 0 ? 1 : commentQuery.Page }; return new { query, data }.ToJson(); })); }
public IActionResult GetAssignmentComments([FromRoute] int assignmentId, [FromQuery] AssignmentCommentQuery commentQuery) { return(this.Ok(() => { var data = _AssignmentRepo.GetAllAssignmentComments(assignmentId, commentQuery); var query = new { PageSize = commentQuery.PageSize <= 0 ? 50 : commentQuery.PageSize, Page = commentQuery.Page <= 0 ? 1 : commentQuery.Page }; return new { query, data }; }, _Logger)); }