public IActionResult Checkout(Purchase order) { var items = _shoppingCart.GetShoppingCartItems(); _shoppingCart.ShoppingCartItems = items; if (_shoppingCart.ShoppingCartItems.Count == 0) { ModelState.AddModelError("", "Your card is empty, buy some pets first"); } if (ModelState.IsValid) { _orderRepository.CreateOrder(order); _shoppingCart.ClearCart(); return(RedirectToAction("CheckoutComplete", new { purchaseId = order.PurchaseId })); } return(View(order)); }