public ActionResult DeleteConfirmed(int id) { Effort effort = db.Efforts.Find(id); if (!EntityAuthorization.EffortDelete(effort)) { return(HttpNotFound()); } db.Efforts.Remove(effort); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Efforts/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Effort effort = db.Efforts.Find(id); if (effort == null) { return(HttpNotFound()); } if (!EntityAuthorization.EffortDelete(effort)) { return(HttpNotFound()); } return(View(effort)); }