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