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); }
public async Task <IActionResult> GetAll() { GetAllMagazineView getMagazine = await _magazineService.GetAll(); return(Ok(getMagazine)); }