Example #1
0
        public async override Task OnNavigatedTo(NavigationEventArgs e)
        {
            var pokes = pokemonsRepository.GetAllPokemons();
            var moves = moveRepository.GetAllMoves();

            allPokemonsCache = await pokemonsRepository.GetAllPokemons();

            allMovesCache = await moveRepository.GetAllMoves();
        }
Example #2
0
        public override async Task OnNavigatedTo(NavigationEventArgs e)
        {
            var pokes = _pokemonsRepository.GetAllPokemons();

            _allPokemonsCache = (await pokes).ToList();

            AllPokemonsByDexNumber = _allPokemonsCache.OrderBy(poke => poke.DexNumber).Take(20);
            AllPokemonsByCp        = _allPokemonsCache.OrderBy(poke => poke.Cp.Max);
            AllPokemonsByName      = _allPokemonsCache.OrderBy(poke => poke.Name);
            AllPokemonsByType      = _allPokemonsCache.OrderBy(poke => poke.Types[0]);
        }
Example #3
0
 public ActionResult <IEnumerable <Pokemon> > Get()
 {
     try
     {
         return(Ok(_pokemonRepository.GetAllPokemons()));
     }
     catch (Exception ex)
     {
         return(BadRequest("Failed to get all pokemons"));
     }
 }
Example #4
0
 public async Task <List <PokemonListViewModel> > GetAllPokemons()
 {
     return(_mapper.Map <List <PokemonListViewModel> >(await _pokemonRepository.GetAllPokemons()));
 }