public ActionResult Delete(int?id) { if (id == null) { return(RedirectToAction("Index", "Home")); } var db = new FavorDbContext(); var fullFavor = db.Favors.FirstOrDefault(f => f.Id == id); if (fullFavor == null) { return(RedirectToAction("Index", "Home")); } var favorDeleteModel = new FavorDeleteViewModel { Title = fullFavor.Title, Description = fullFavor.Description, Id = fullFavor.Id }; return(View(favorDeleteModel)); }