コード例 #1
0
        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();
            }));
        }
コード例 #2
0
        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));
        }