コード例 #1
0
        public async Task <IActionResult> GetAllBulletin()
        {
            var allBulletin = await _diag.GetAllBulletin();

            //  var allBulletinMapped = _mapper.Map<TreatmentBulletinForReturnDto>(allBulletin);

            List <TreatmentBulletinForReturnDto> allBulletinMapped = new List <TreatmentBulletinForReturnDto>();

            foreach (var item in allBulletin)
            {
                var allMapped = new TreatmentBulletinForReturnDto();
                var drugname  = await _diag.GetDrugById(item.DrugId);

                allMapped.TreatmentBulletinId = item.TreatmentBulletinId;
                allMapped.Composition         = item.Composition;
                allMapped.Indications         = item.Indications;
                allMapped.SideEffects         = item.SideEffects;
                allMapped.Dosing = item.Dosing;

                allMapped.DrugName = drugname.DrugName;
                allBulletinMapped.Add(allMapped);
            }
            return(Ok(allBulletinMapped));
        }