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