public ActionResult Create(Relation relation) { if (ModelState.IsValid) { this.db.Relations.Add(relation); this.db.SaveChanges(); return RedirectToAction("Index"); } return View(relation); }
public ActionResult Edit(Relation relation) { if (ModelState.IsValid) { this.db.Entry(relation).State = EntityState.Modified; this.db.SaveChanges(); return RedirectToAction("Index"); } return View(relation); }