Exemplo n.º 1
0
        public async Task <PagedList <GroupOfDetailDTO> > GetPagedGroupOfDetails(GroupOfDetailParameters parameters)
        {
            var x = await _eFUnitOfWork.EFGroupOfDetailRepository.GetPagedGroupOfDetails(parameters);

            var result = _mapper.Map <PagedList <GroupOfDetailDTO> >(x);

            return(result);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Get([FromQuery] GroupOfDetailParameters parameters)
        {
            if (!parameters.ValidPriceRange)
            {
                return(BadRequest("Invalid range!"));
            }

            return(Ok(await _iEFGroupOfDetailService.GetPagedGroupOfDetails(parameters)));
        }
Exemplo n.º 3
0
        public async Task <PagedList <GroupOfDetail> > GetPagedGroupOfDetails(GroupOfDetailParameters parameters)
        {
            var groupOfDetails = FindByCondition(o => o.PriceOfGroupOfDetail >= parameters.MinPrice && o.PriceOfGroupOfDetail <= parameters.MaxPrice); // filtering

            SearchByName(ref groupOfDetails, parameters.State);                                                                                        // searching

            groupOfDetails = _sortHelper.ApplySort(groupOfDetails, parameters);                                                                        // sorting

            return(await PagedList <GroupOfDetail> .ToPagedList(groupOfDetails, parameters.PageNumber, parameters.PageSize));                          // paging
        }