Exemplo n.º 1
0
        public async Task <IEnumerable <MedicineDomain> > GetMedicines()
        {
            var medicines = await _medicineRepository.GetMedicines();

            var medicinesDomain = _mapper.Map <List <MedicineDomain> >(medicines);

            return(medicinesDomain);
        }
Exemplo n.º 2
0
        public IEnumerable <MedicineDto> GetAllMedicinesForAPrescription(int prescriptionId, string filterString)
        {
            var medicineEntities = medicineRepository.GetMedicines().Where(x => x.PrescriptionId == prescriptionId);

            if (!string.IsNullOrEmpty(filterString))
            {
                medicineEntities = medicineEntities.Where(x => x.Name.Contains(filterString) || x.CompanyName.Contains(filterString));
            }

            return(mapper.Map(medicineEntities));
        }
        /// <summary>
        /// get all medicines
        /// </summary>
        /// <returns></returns>
        public async Task <IEnumerable <MedicineDto> > GetAllMedicines()
        {
            try
            {
                var medicines = await _medicineRepository.GetMedicines();

                return(_mapper.Map <IEnumerable <MedicineDto> >(medicines));
            }
            catch (Exception ex)
            {
                _logger.LogError($"Error Occured in {this.GetType().Name}. Error: {ex.Message}");
                throw;
            }
        }
Exemplo n.º 4
0
 public async Task <IEnumerable <Medicines> > GetMedicines()
 {
     return(await _medicienRepo.GetMedicines());
 }
 public List <Medicine> GetMedicines()
 {
     return(m_MedicineRepository.GetMedicines());
 }
 public async Task <ActionResult <IEnumerable <Medicine> > > GetMedicines()
 {
     return(Ok(await _repository.GetMedicines()));
 }