public async Task <GetAllAuthorView> GetAll() { var authors = (await _authorRepository.GetAll()).Select(x => new AuthorGetAllAuthorViewsItem { Name = x.Name, Id = x.Id }).ToList(); var result = new GetAllAuthorView() { Authors = authors }; result.Authors = authors; return(result); }
public async Task <IActionResult> GetAll() { GetAllAuthorView getAllAuthors = await _authorService.GetAll(); return(Ok(getAllAuthors)); }