Exemple #1
0
        public ActionResult Create(Major major)
        {
            if (ModelState.IsValid)
            {
                db.Majors.Add(major);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(major);
        }
Exemple #2
0
 public ActionResult Edit(Major major)
 {
     if (ModelState.IsValid)
     {
         db.Entry(major).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(major);
 }