Esempio n. 1
0
        public ActionResult Create(Campus campus)
        {
            if (ModelState.IsValid)
            {
                db.campuses.Add(campus);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(campus);
        }
Esempio n. 2
0
 public ActionResult Edit(Campus campus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(campus).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(campus);
 }