예제 #1
0
        public async Task <IActionResult> Edit(long id, CartItem cart)
        {
            if (id != cart.Id)
            {
                return(BadRequest());
            }
            try
            {
                await _cartRepository.Edit(cart);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CartExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok());
        }