Пример #1
0
 public ActionResult Edit(Education education)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(education).State = EntityState.Modified;
         _db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.PossibleUser = _db.Users;
     return View(education);
 }
Пример #2
0
        public ActionResult Create(Education education)
        {
            if (ModelState.IsValid)
            {
                _db.Educations.Add(education);
                _db.SaveChanges();
                return RedirectToAction("Index");  
            }

            ViewBag.PossibleUser = _db.Users;
            return View(education);
        }