Esempio n. 1
0
        public async Task <GetAllBrochureViewModel> GetAll()
        {
            var result = new GetAllBrochureViewModel();
            IEnumerable <Brochure> brochuresList = await _brochureRepository.GetAll();

            var brochureVMItemList = Mapper.Map <IEnumerable <Brochure>, List <BrochureGetAllBrochureViewModelItem> >(brochuresList);

            result.Brochures = brochureVMItemList;
            return(result);
        }
        public async Task <IActionResult> GetAll()
        {
            GetAllBrochureViewModel getAllBrochureViewModel = await _service.GetAll();

            return(Ok(getAllBrochureViewModel));
        }