public ActionResult Create(Product product) { PharmaTest_NREntities entities = new PharmaTest_NREntities(); entities.Products.Add(product); entities.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Product product) { PharmaTest_NREntities entities = new PharmaTest_NREntities(); if (ModelState.IsValid) { entities.Entry(product).State = EntityState.Modified; entities.SaveChanges(); return(RedirectToAction("Index")); } return(View(product)); }