public List <Domain.Entities.Medications.Medication> GetAllMedicationsByNameOrId(string query)
 {
     if (int.TryParse(query, out int id))
     {
         return(_medicationRepository.GetAll().Where(med => med.Id == id).ToList());
     }
     return(_medicationRepository.GetAll().Where(med => med.Med.ToLower().Contains(query.ToLower())).ToList());
 }
        public async Task <PagedResult <MedicationDto> > GetAll(string externalId)
        {
            var result = await _repository.GetAll(externalId);

            var mapperActivities = _mapper.Map <IList <Medication>, IList <MedicationDto> >(result.Items);

            return(new PagedResult <MedicationDto>()
            {
                Results = mapperActivities
            });
        }
        public void Get_Returns_List_Of_Medications()
        {
            var expected = new List <Medication>();

            repo.GetAll().Returns(expected);

            var result = underTest.Get();

            Assert.IsType <List <Medication> >(result.Value);
        }
 public IEnumerable <Medication> GetAll() => medicationRepository.GetAll();
 public ActionResult <List <Medication> > Get()
 {
     return(repo.GetAll());
 }