Example #1
0
        public async Task <GetAllMagazineView> GetAll()
        {
            var magazines = (await _magazineRepository.GetAll()).Select(x => new MagazineGetAllMagazineViewItem {
                Id = x.Id, Title = x.Title, Price = x.Price
            }).ToList();
            GetAllMagazineView result = new GetAllMagazineView();

            result.MagazineItem = magazines;
            return(result);
        }
Example #2
0
        public async Task <IActionResult> GetAll()
        {
            GetAllMagazineView getMagazine = await _magazineService.GetAll();

            return(Ok(getMagazine));
        }