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