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