Exemplo n.º 1
0
        public async Task <IActionResult> GetPromocodes([FromQuery] PromocodeParams promocodeParams)
        {
            var promocodes = await _repo.GetPromocodes(promocodeParams);

            var promocodesToReturn = _mapper.Map <IEnumerable <PromocodeForListDTO> >(promocodes);

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

            return(Ok(promocodesToReturn));
        }