An attempt has been made to Attach or Add an entity that is not new Linq to Sql error
- by Collin Oconnor
I have a save function for my order entity that looks like this and it breaks on the sumbmitChanges line:
public void SaveOrder ( Order order ) {
if (order.OrderId == 0)
orderTable.InsertOnSubmit(order);
else if (orderTable.GetOriginalEntityState(order) == null) {
…