Example #1
0
        public IActionResult GetAllDoctorsInSpecailty(int SpecailtyID)
        {
            List <GetDoctorDto> doctors = this._doctorAppService.GetAllDoctorWhere(SpecailtyID);

            foreach (var doctor in doctors)
            {
                var _services    = _doctor_DoctorServiceAppService.GetDoctorServices(doctor.UserId);
                var _subSpecails = _doctorSubSpecialization.GetSubSpecialtyByDoctorId(doctor.UserId);
                var _clinic      = _clinicAppService.GetByStringId(doctor.UserId);

                double doctorAverageRate = _ratingAppService.getPublicRateForDoctor(doctor.UserId);


                doctor.services       = _services;
                doctor.subspecails    = _subSpecails;
                doctor.clinic         = _clinic;
                doctor.clinicAreaName = _areaAppService.GetById(_clinic.AreaId).Name;
                doctor.clinicCityName = _cityAppService.Get(_clinic.CityId).Name;
                IEnumerable <GetWorkingDayDTO> workingDaysDTOs = _workingDayAppService.GetWorkingDaysForDoctor(doctor.UserId);
                doctor.workingDays = workingDaysDTOs.ToList();
                doctor.averageRate = doctorAverageRate;
            }


            return(Ok(doctors));
        }
Example #2
0
 public IActionResult Get(int id)
 {
     return(Ok(_areaAppServices.GetById(id)));
 }