public ActionResult Create(Material material) { //Check if model is valid, then add Materials to table and save changes to Database if (ModelState.IsValid) { db.Materials.Add(material); db.SaveChanges(); return RedirectToAction("Index"); } return View(material); }
public ActionResult Edit(Material material) { //Check if model is valid, then edit Materials to table and save changes to Database if (ModelState.IsValid) { db.Entry(material).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(material); }