public async Task <SpecialistResponse> DeleteAsync(int id) { var existingSpecialist = await _specialistRepository.FindById(id); if (existingSpecialist == null) { return(new SpecialistResponse("Specialist not found")); } try { _specialistRepository.Remove(existingSpecialist); await _unitOfWork.CompleteAsync(); return(new SpecialistResponse(existingSpecialist)); } catch (Exception ex) { return(new SpecialistResponse($"An error ocurred while deleting specialist: {ex.Message}")); } }