public ActionResult DeleteConfirm(string Id) { var productToRemove = context.Find(Id); if (productToRemove != null) { context.Delete(productToRemove); context.Commit(); return(RedirectToAction("List")); } else { return(new HttpNotFoundResult("Not Found")); } }