Пример #1
0
        public async Task <List <AuthorOutputDto> > GetAll()
        {
            List <AuthorOutputDto> authors = new List <AuthorOutputDto>();

            var result = await _authorManager.GetAllAsync();

            foreach (var item in result)
            {
                //var author = await _authorRepository.GetAsync(item.AuthorId);
                //var author = await _authorRepository.GetAsync(item.AuthorId);
                authors.Add(new AuthorOutputDto()
                {
                    DisplayName  = item.DisplayName,
                    Id           = item.Id,
                    Age          = item.Age,
                    EmailAddress = item.EmailAddress
                });
            }

            return(authors);
        }