public IActionResult GetAll([FromQuery] AssignmentQuery filters) { return(this.Ok(() => new { filters = filters.ToJson(), results = _AssignmentRepo.GetByFilters(filters).ToJsonArray() }, _Logger)); }
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)); }
public IActionResult GetAll([FromQuery] AssignmentQuery filters) { return(this.Ok(() => { JObject result = new JObject { ["filters"] = filters.ToJson(), ["results"] = _AssignmentRepo.GetByFilters(filters).ToJsonArray() }; return result; })); }