Esempio n. 1
0
 public async Task <IActionResult> DeletePokemonCatchRange([FromBody] GuidSyncDTO toDelete)
 {//de save parameter wordt niet meegegeven
     foreach (Guid id in toDelete.PokemonCatches)
     {
         await DeletePokemonCatch(id, false); //hier worden ook de moveCatches verwijderd
     }
     return(Ok(new List <PokemonCatch>()));   //de DelCallAPI function in Xamarin verwacht een List van PokemonCatches
 }
Esempio n. 2
0
        public async Task <IActionResult> GetAllPokemonCatchesByGuidRange([FromBody] GuidSyncDTO pokemon)
        {
            List <PokemonCatch> pokemonCatches = await unitOfWork.PokemonCatches.GetAllByGuidRange(pokemon.PokemonCatches);

            List <PokemonMoveCatch> pokemonMoveCatches = new List <PokemonMoveCatch>();

            foreach (var pokemonCatch in pokemonCatches)
            {
                List <PokemonMoveCatch> foundMoveCatches = await unitOfWork.PokemonMoveCatches.GetAllByPokemonCatchId(pokemonCatch.Id);

                pokemonMoveCatches.AddRange(foundMoveCatches);
            }

            PokemonCatchSyncDTO syncDTO = new PokemonCatchSyncDTO
            {
                UserId             = pokemon.UserId,
                PokemonCatches     = pokemonCatches,
                PokemonMoveCatches = pokemonMoveCatches
            };

            return(Ok(syncDTO));
        }