public async Task <IActionResult> PostOrder(OrderWithCustomerViewModel orderWithCustomer) { var ids = servicesCart.GetCartItems(); var shopItems = shopCartRep.GetShopCartItems(ids); if (!orderRep.CheckProductsInStock(shopItems)) { return(RedirectToAction("ShopCart", "Index", new { message = "К сожалению на складе нет товаров в таком количестве" })); } await orderRep.CreateOrderAsync(orderWithCustomer.User, shopItems, orderWithCustomer.Order); servicesCart.Drop(); return(RedirectToAction("VariousInf", "Order", new { inf = "Заказ успешно создан" })); }