示例#1
0
 public IActionResult PlaceOrder(CartViewModel viewModel)
 {
     Order order = new Order();
     order.Cart = new Cart();
     order.User.UserID = Convert.ToInt32(User.Claims.FirstOrDefault(c => c.Type == "UserID")?.Value);
     order.Cart = _cartLogic.GetProductsFromCart(order.User.UserID);
     _orderLogic.PlaceOrder(order);
     _orderLogic.DeletCartTable(order);
     return RedirectToAction("Order");
 }