public void UpdateCategory(Category category) { using (var context = new MvcComContext()) { context.Entry(category).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void UpdateProduct(Product product) { using (var context = new MvcComContext()) { context.Entry(product).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }