public List <Nurse> GetAll() { var nurses = nurseRepository.GetAll(); if (nurses != null && nurses.Count > 0) { foreach (var item in nurses) { item.user = userRepository.GetUserById(item.id); var nurseSpecialties = nurseRepository.GetNurseSpecialtiesById(item.id); if (nurseSpecialties != null) { item.nurseSpecialties = nurseSpecialties; } } } return(nurses); }
public async Task <IActionResult> GetAll([FromServices] INurseRepository repository) { var result = await repository.GetAll(); return(Ok(_mapper.Map <IEnumerable <NurseViewModel> >(result))); }
public async Task <IEnumerable <Nurse> > GetAll() { var response = await _nurseRepository.GetAll(); return(response); }
public IQueryable <Nurse> GetNurses() { return(_repository.GetAll()); }