Example #1
0
        public async Task <List <PokemonListingViewModel> > GetNationalDex()
        {
            List <tlkpNationalDex> nationalDex = await _pokedexRepository.GetNationalDex();

            List <PokemonListingViewModel> pokemonListingViewModel = MapNationalDexLookupsToListingViewModels(nationalDex);

            return(pokemonListingViewModel);
        }
Example #2
0
        public async Task <List <GenericPokemonResult> > GetNationalDex()
        {
            List <tlkpNationalDex> nationalDex = await _pokedexRepository.GetNationalDex();

            _logger.LogInformation(string.Format(Constants.InformationalMessageMappingWithCount, nationalDex.Count, Constants.NationalDex, Results));

            return(nationalDex.Select(a => new GenericPokemonResult
            {
                Ability = a.Ability.Name,
                Category = a.Category.Name,
                Description = a.Description,
                HeightInInches = a.HeightInInches,
                HiddenAbility = a.HiddenAbilityId.HasValue ? a.HiddenAbility.Name : Constants.NotApplicable,
                ImageURL = a.ImageURL,
                JapaneseName = a.JapaneseName,
                Name = a.Name,
                NationalDexPokemonId = a.Id,
                TypeOne = a.TypeOne.Name,
                TypeTwo = a.TypeTwoId.HasValue ? a.TypeTwo.Name : Constants.NotApplicable,
                WeightInPounds = a.WeightInPounds
            }).ToList());
        }