Esempio n. 1
0
        public async Task SeedPokemons()
        {
            if (!await _pokeDbRepository.Any())
            {
                var jsonResults = await RequestPokemonsFromApi();

                var entities = _mapper.Map <List <DAL.DbContext.Entities.Pokemon> >(jsonResults);
                _pokeDbRepository.AddRange(entities);
                await _pokeDbRepository.Save();
            }
        }