public IActionResult Index(string filterString) { var doctorDtos = _doctorManager.GetAllDoctors(filterString); var doctorViewModels = _vMMapper.Map(doctorDtos); return(View(doctorViewModels)); }
public IActionResult Index(int doctorId, string filterString) { TempData["DoctorId"] = doctorId; var doctorDto = _DoctorManager.GetAllDoctors(null).FirstOrDefault(x => x.Id == doctorId); var prescriptionDtos = _DoctorManager.GetAllPrescriptionForADoctor(doctorId, filterString); var doctorViewModel = _ViewModelMapper.Map(doctorDto); doctorViewModel.Prescriptions = _ViewModelMapper.Map(prescriptionDtos).ToList(); return(View(doctorViewModel)); }
public IActionResult Index(int doctorId, string filterString) { DoctorId = doctorId; var doctorDtos = _doctorManager.GetAllDoctors(null) .FirstOrDefault(x => x.Id == doctorId); var prescriptionDtos = _doctorManager.GetAllPrescriptionForADoctor(doctorId, filterString); var doctorViewModels = _vMMapper.Map(doctorDtos); doctorViewModels.Prescriptions = _vMMapper.Map(prescriptionDtos); return(View(doctorViewModels)); }