Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetAll()
        {
            GetAllAuthorView getAllAuthors = await _authorService.GetAll();

            return(Ok(getAllAuthors));
        }