Beispiel #1
0
        public async Task <IEnumerable <DrugDTO> > GetDrugs()
        {
            if (!ModelState.IsValid)
            {
                return(null);
            }
            var drug = await drugRepository.GetAllDrugsAsync();

            var drugDtoCollection = new List <DrugDTO>();

            drug.ToList().ForEach(x => drugDtoCollection.Add(mapper.Map <Drug, DrugDTO>(x)));
            return(drugDtoCollection);
        }