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