public IEnumerable <PrescriptionDto> GetPrescriptionsForDoctor(int doctorId, string filterString) { var prescriptionEntities = _prescriptionRepository.GetAllPrescriptions().Where(x => x.DoctorId == doctorId); if (!string.IsNullOrEmpty(filterString)) { prescriptionEntities = prescriptionEntities.Where(x => x.Name.ToLower().Contains(filterString.ToLower())); } return(_mapper.Map(prescriptionEntities)); }
public List <PrescriptionDTO> GetAllPrescriptionForADoctor(int doctorId, string filterstring) { var prescriptionEntities = _prescriptionRepository.GetAllPrescriptions().Where(x => x.DoctorId == doctorId).ToList(); if (!string.IsNullOrEmpty(filterstring)) { prescriptionEntities = prescriptionEntities .Where(x => x.Name.ToLower().Contains(filterstring.ToLower())).ToList(); } return(_DTOMappers.Map(prescriptionEntities)); }