public ActionResult Edit(int id, ProductModel product) { if (ModelState.IsValid && id == product.ID) { db.Entry(product).State = System.Data.EntityState.Modified; db.SaveChanges(); } return RedirectToAction(""); }
public ActionResult Create(ProductModel product) { if(ModelState.IsValid) { db.Products.Add(product); db.SaveChanges(); } return RedirectToAction(""); }