public ActionResult Create(ProductModels productmodels) { if (ModelState.IsValid) { db.Products.Add(productmodels); db.SaveChanges(); return RedirectToAction("Index"); } return View(productmodels); }
public ActionResult Edit(ProductModels productmodels) { if (ModelState.IsValid) { db.Entry(productmodels).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(productmodels); }