// GET: RegistrationClients/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var registration = registrationRepository.FindRegistration(id); // Registration registration = db.Registrations.Find(id); if (registration == null) { return(HttpNotFound()); } return(View(registration)); }