public async Task <IActionResult> Delete([FromRoute] int id) { var patient = await _clinicRepository.GetPatientByIDAsync(id); if (patient != null) { try { await _clinicRepository.DeletePatientAsync(id); return(Ok()); } catch (Exception e) { _logger.LogError(e.InnerException.Message); return(NotFound()); } } else { return(NotFound()); } }