public IActionResult Checkout(OrderViewModel model) { Order order = new Order { GameList = OrderLogic.GetShoppingList(), OrderStatus = OrderStatus.Waiting, Address = model.Address, OrderDate = model.Order.OrderDate }; var email = HttpContext.Session.GetString("_Name"); order.UserId = AccountLogic.GetUser(email).Id; OrderLogic.AddOrder(order); int orderId = OrderLogic.GetOrderId(); OrderLogic.AddGamesOrder(order.GameList, orderId); OrderLogic.ClearShoppingList(); return(RedirectToAction("Index", "Home")); }