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