예제 #1
0
 public async Task <IList <PokemonSkill> > GetAll()
 {
     using (var db = Db)
     {
         var pokemonSkillRepository = new PokemonSkillRepository(db);
         return(await pokemonSkillRepository.GetAll());
     }
 }
예제 #2
0
        private async Task <List <PokemonSkill> > GetPokemonSkills(int id, PokedexContext db)
        {
            var pokemonToPokemonSkillRepository = new PokemonToPokemonSkillRepository(db);
            var task = await pokemonToPokemonSkillRepository.GetByPokemonId(id);

            var results = task.Select(x => x.PokemonSkillId);

            var pokemonSkillRepository = new PokemonSkillRepository(db);
            var task2 = await pokemonSkillRepository.GetAll();

            return(task2.Where(x => results.Contains(x.Id)).ToList());
        }