public async Task <IEnumerable <Doctor> > GetDoctorsRepositoryAsync(DoctorsType doctorsType) { DoctorFactory doctorFactory = new DoctorFactory(_context); var doctors = await doctorFactory.GetDoctors(doctorsType); return(doctors); }
/// <summary> /// Метод который вернет список докторов в зависимости от типа. /// </summary> /// <param name="doctorsType"> Условие, которые указывает каких докторов вернуть. </param> /// <returns> Список врачей. </returns> public async Task <IEnumerable <Doctor> > GetDoctors(DoctorsType doctorsType) { switch (doctorsType) { case DoctorsType.AllDoctors: return(await GetAllDoctorsAsync()); case DoctorsType.EnableDoctors: return(await GetEnableDoctorsAsync()); case DoctorsType.DoctorsWithRoleDoctor: return(await GetDoctorsWithRoleDoctorAsync()); default: return(null); } }
public async Task <IEnumerable <Doctor> > GetDoctorsAsync(DoctorsType doctorsType) { return(await _doctorRepository.GetDoctorsRepositoryAsync(doctorsType)); }