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

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