public ActionResult Edit(Dinner dinner) { if (!dinner.IsHostedBy(User.Identity.Name)) { return View("InvalidOwner"); } if (ModelState.IsValid) { db.Entry(dinner).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(dinner); }