Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetAll([FromServices] INurseRepository repository)
        {
            var result = await repository.GetAll();

            return(Ok(_mapper.Map <IEnumerable <NurseViewModel> >(result)));
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <Nurse> > GetAll()
        {
            var response = await _nurseRepository.GetAll();

            return(response);
        }
Ejemplo n.º 4
0
 public IQueryable <Nurse> GetNurses()
 {
     return(_repository.GetAll());
 }