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