コード例 #1
0
 public IActionResult GetAll([FromQuery] AssignmentQuery filters)
 {
     return(this.Ok(() => new
     {
         filters = filters.ToJson(),
         results = _AssignmentRepo.GetByFilters(filters).ToJsonArray()
     }, _Logger));
 }
コード例 #2
0
        public IEnumerable <AssignmentDTO> GetByFilters(AssignmentQuery filters)
        {
            IQueryable <Assignment> assignments = _Context.Assignments
                                                  .GetByTitle(filters.Title)
                                                  .GetByDatesRange(filters.StartDate, filters.EndDate)
                                                  .GetByPointsRange(filters.StartPoints, filters.StartPoints)
                                                  .GetByTags(filters.Tags)
                                                  .Pagination(filters.Page, filters.PageSize);

            return(_Mapper.Map <IEnumerable <Assignment>, IEnumerable <AssignmentDTO> >(assignments));
        }
コード例 #3
0
        public IActionResult GetAll([FromQuery] AssignmentQuery filters)
        {
            return(this.Ok(() =>
            {
                JObject result = new JObject
                {
                    ["filters"] = filters.ToJson(),
                    ["results"] = _AssignmentRepo.GetByFilters(filters).ToJsonArray()
                };

                return result;
            }));
        }