public List <PrescriptionDto> GetAllPrescriptionForADoctor(int doctorId, string filterString) { var prescriptionEntities = mPrescriptionRepository.GetAllPrescription().Where(x => x.DoctorId == doctorId).ToList(); if (!string.IsNullOrEmpty(filterString)) { prescriptionEntities = prescriptionEntities .Where(x => x.Name.Contains(filterString)) .ToList(); } return(mDtoMapper.Map(prescriptionEntities)); }