2010-12-10 94 views

回答

0

使用此代碼:

var order = new Order(); 
//fill your properties here 

var orderDetails = new OrderDetails(); 
//fill your properties here 

orderDetails.Order = order; 

db.AddToOrders(order); 
db.AddToOrderDetails(orderDetails); 

//Save changes 
db.SaveChanges(); 

希望它會幫助你解決問題。