public IActionResult AddItem(int orderId, int productId, int quantity) { var product = _productsService.Get(productId); if (product != null) { if (_ordersService.AddItem(orderId, product.ProductId, quantity) && _ordersService.UpdateTotal(orderId, _productsService.Get())) { return(Ok(_ordersService.Get(orderId))); } return(StatusCode((int)HttpStatusCode.Conflict)); } return(NotFound()); }