Why should I use GetOriginalEntityState() in my LINQ To SQL repository save method?
I'm looking at an example of a save method in a Products repository from Steven Sanderson's book, Pro ASP.NET MVC 2 Framework: public void SaveProduct(Product product) { // if new product, attach to DataContext: if (product.ProductID == 0) productsTable.InsertOnSubmit(product); else if (productsTable.GetOriginalEntityState(product) == null) { // we're updating existing product productsTable.Attach(product); productsTable.Context.Refresh(RefreshMode.KeepCurrentValues, product); } productsTable.Context.SubmitChanges(); } I do not understand the logic in the else if line: else if (productsTable