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()); }
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()); }