This code works, but i dont understand why. With DeferredLoadingEnabld = false, I would expect it not to return the primary key. Can someone explain what I am missing?
public void SaveOrder (Order order)
{
using (DataContext dc= new DataContext)
{
dc.DeferredLoadingEnabled = false;
...
order.Total= total;
dc.order.InsertOnSubmit(order);
dc.SubmitChanges();
}
}
IN ORDER SERVICE:
public void ServiceSaveOrder(Order order)
{
Order order= new Order();
SaveOrder(order);
Print(order.ID); //ID= unique primary key
}