Exemple #1
0
        public async Task <IActionResult> GetManufacturers([FromQuery] ManufacturerParams manufacturerParams)
        {
            var manufacturers = await _repo.GetManufacturers(manufacturerParams);

            var manufacturersToReturn = _mapper.Map <IEnumerable <ManufacturerForListDto> >(manufacturers);

            Response.AddPagination(manufacturers.CurrentPage, manufacturers.PageSize,
                                   manufacturers.TotalCount, manufacturers.TotalPages);

            return(Ok(manufacturersToReturn));
        }