public ActionResult Create(Group group) { if (ModelState.IsValid) { db.Groups.Add(group); db.SaveChanges(); return RedirectToAction("Index"); } return View(group); }
public ActionResult Edit(Group group) { if (ModelState.IsValid) { db.Entry(group).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(group); }