示例#1
0
        private async Task <List <SelectListItem> > GetPokeballSelectListItems(SelectListItem prependOption)
        {
            List <tlkpPokeball> pokeballs = await _pokedexRepository.GetAllPokeballs();

            return(pokeballs.Select(p => new SelectListItem
            {
                Text = p.Name,
                Value = p.Id.ToString()
            }).Prepend(prependOption).ToList());
        }
示例#2
0
        public async Task <List <GenericLookupResult> > GetAllPokeballs()
        {
            List <tlkpPokeball> pokeballs = await _pokedexRepository.GetAllPokeballs();

            _logger.LogInformation(string.Format(Constants.InformationalMessageMappingWithCount, pokeballs.Count, Constants.Pokeball, Results));

            return(pokeballs.Select(a => new GenericLookupResult
            {
                Id = a.Id,
                Name = a.Name
            }).ToList());
        }