public async Task <PagedList <GroupOfDetailDTO> > GetPagedGroupOfDetails(GroupOfDetailParameters parameters) { var x = await _eFUnitOfWork.EFGroupOfDetailRepository.GetPagedGroupOfDetails(parameters); var result = _mapper.Map <PagedList <GroupOfDetailDTO> >(x); return(result); }
public async Task <IActionResult> Get([FromQuery] GroupOfDetailParameters parameters) { if (!parameters.ValidPriceRange) { return(BadRequest("Invalid range!")); } return(Ok(await _iEFGroupOfDetailService.GetPagedGroupOfDetails(parameters))); }
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 }