public void SaveOrder(Order order) { _ctx.AttachRange(order.Lines.Select(l => l.Product)); if (order.OrderID == 0) { _ctx.Orders.Add(order); } _ctx.SaveChanges(); }
public void SaveOrder(Order order) { _ctx.AttachRange(order.Lines.Select(l => l.Product)); if (order.OrderID == 0) { _ctx.Orders.Add(order); } _ctx.SaveChanges(); }