예제 #1
0
        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));
        }
예제 #2
0
        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));
        }