public ActionResult DeletePatient(int id) { var patient = patientRepository.GetPatientById(id); var exercises = exerciseRepository.GetAllPatientExercises(patient.Id); //Usuwanie wszystkich cwiczeń dla pacjenta exerciseRepository.DeleteExercises(exercises); exerciseRepository.Complete(); patientRepository.DeletePatient(patient); patientRepository.Complete(); return(RedirectToAction("PatientList")); }