Пример #1
0
        public ActionResult Create(School Schools)
        {
            if (ModelState.IsValid)
            {
                db.Schools.Add(Schools);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(Schools);
        }
Пример #2
0
 public ActionResult Edit(School Schools)
 {
     if (ModelState.IsValid)
     {
         db.Entry(Schools).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(Schools);
 }