public IActionResult DeleteExamiantion(int patientId, int exmiantionId) { if (_patientInfoRepository.PatientExists(patientId)) { return(NotFound()); } var examination = _patientInfoRepository.GetExamination(patientId, exmiantionId); if (examination == null) { return(NotFound()); } _patientInfoRepository.DeleteExam(examination); if (!_patientInfoRepository.Save()) { return(StatusCode(500, "Internal Server Error")); } return(NoContent()); }