Exemplo n.º 1
0
        public async Task <IActionResult> UpdateCartProduct(int cartId, CartProductUpdateDto productToUpdate)
        {
            var productCart = await _repo.GetCartProduct(cartId, productToUpdate.ProductId);

            _mapper.Map(productToUpdate, productCart);
            if (await _repo.SaveAll())
            {
                return(NoContent());
            }
            throw new Exception($"Updating cart failed on save");
        }