G’day All, has anyone purchased the ALPHA of Apress Pro Asp.net MVC Framework 3 and created the SportsStore? I can’t for the life of me edit products and have the DB update suc
The state of the EF object needs to be updated before saving.
public void SaveProduct(Product product) { if (product.ProductID == 0) { context.Products.Add(product); } else { context.Entry(product).State = System.Data.EntityState.Modified; } int result = context.SaveChanges(); }