Esempio n. 1
0
        public async Task <SavePokemonResponse> SaveAsync(Pokemon pokemon)
        {
            try
            {
                await _pokemonRepository.AddAsync(pokemon);

                await _unitOfWork.CompleteAsync();

                return(new SavePokemonResponse(pokemon));
            }
            catch (Exception ex)
            {
                return(new SavePokemonResponse($"Nao foi possivel salvar o Pokemon: {ex.Message}"));
            }
        }