Example #1
0
        public ListJobsParameters()
        {
            this.Filter  = new ListJobsFilter();
            this.Sorting = new ListJobsSorting();

            this.Sorting.BySubmitTime(AdlClient.OData.Models.OrderByDirection.Descending);
        }
Example #2
0
        public IActionResult List([FromQuery] ListJobsFilter filter)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("ModelState is invalid"));
            }

            var geo  = new GeoCoordinate(filter.Latitude, filter.Longitude);
            var jobs = unitOfWork.Job.SearchAndPaginate(filter.CityName, geo, filter.Page, filter.Size, out var total);

            var result = new ListResponse <JobListDto>
            {
                Total = total,
                Data  = mapper.Map <IEnumerable <JobListDto> >(jobs)
            };

            return(Ok(result));
        }