Exemplo n.º 1
0
        public async Task <GetAllMagazineViewModel> GetAll()
        {
            var result = new GetAllMagazineViewModel();
            IEnumerable <Magazine> magazinesList = await _magazineRepository.GetAll();

            var magazineVMItemList = Mapper.Map <IEnumerable <Magazine>, List <MagazineGetAllMagazineViewModelItem> >(magazinesList);

            result.Magazines = magazineVMItemList;
            return(result);
        }
        public async Task <IActionResult> GetAll()
        {
            GetAllMagazineViewModel getAllMahazineViewModel = await _service.GetAll();

            return(Ok(getAllMahazineViewModel));
        }