public async Task <bool> deleteAsync(long id) { try { Paciente pac = await pacRepo.GetPacienteAsync(id); pac.medicos = new HashSet <MedicoPaciente>(); await this.updateAsync(pac); foreach (Cita c in pac.citas) { await diagRepo.DeleteDiagnosticoAsync(c.diagnostico.id); await citaRepo.DeleteCitaAsync(c.id); } pac.citas = new HashSet <Cita>(); await pacRepo.DeletePacienteAsync(id); return(true); } catch (Exception) { return(false); } }