Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion demo/ChengFenStore/Services/OrderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public OrderService(OrderRepository orderRepository)

public Order CreateOrder(Order order)
{
return _orderRepository.AddOrder(order);
_orderRepository.AddOrder(order);
return order;
}

public Order GetOrderById(int id)
Expand All @@ -29,6 +30,9 @@ public Order ConfirmOrder(int id)
{
order.OrderStatus = "已支付";
_orderRepository.UpdateOrder(order);
// Save changes to the database
// Assuming _orderRepository is using a DbContext, call SaveChanges() here
// _orderRepository.SaveChanges();
}
return order;
}
Expand Down