public async Task <IActionResult> GetProducts([FromQuery] ProductParams productParams) { var products = await _repo.GetProducts(productParams); var productsToReturn = _mapper.Map <IEnumerable <ProductReturnDTO> >(products); Response.AddPagination(products.CurrentPage, products.PageSize, products.TotalCount, products.TotalPages); return(Ok(productsToReturn)); }