public Doctor GetEager(long id)
        {
            Doctor doctor = Get(id);

            List <BusinessDay> businessDays = new List <BusinessDay>();

            if (doctor.BusinessDay != null)
            {
                foreach (BusinessDay day in doctor.BusinessDay)
                {
                    businessDays.Add(_businessDayRepository.GetEager(day.GetId()));
                }
            }
            doctor.BusinessDay = businessDays;

            doctor.Specialty          = _specialityRepository.Get(doctor.Specialty.GetId());
            doctor.Address            = _addressRepository.GetEager(doctor.Address.GetId());
            doctor.Address.Town       = _townRepository.GetEager(doctor.Address.Town.GetId());
            doctor.Address.Town.State = _stateRepository.GetEager(doctor.Address.Town.State.GetId());
            doctor.DoctorGrade        = _doctorGradeRepository.Get(doctor.DoctorGrade.GetId());

            return(doctor);
        }
Exemplo n.º 2
0
 public BusinessDay Get(long id)
 {
     return(_businessDayRepository.GetEager(id));
 }