コード例 #1
0
        public async Task <List <CharacterDTO> > GetAllCharactersAsync(IPagination pagination)
        {
            List <Character>?allCharacters = await _characterRepository.GetAllAsPageAsync(
                pagination.ElementIndex,
                pagination.PageSize,
                x => x.Episodes, x => x.Episodes.Select(y => y.Episode),
                x => x.Friends, x => x.Friends.Select(y => y.Friend)
                );

            return(_mapper.Map <List <CharacterDTO> >(allCharacters));
        }