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()); }