public async Task <IActionResult> DeleteAsync(Guid id) { try { await PokemonService.DeleteAsync(id); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <IActionResult> DeleteAsync(Guid id) { var result = await _pokemonService.DeleteAsync(id); if (!result.Success) { return(BadRequest(result.Message)); } var pokemonResource = _mapper.Map <Pokemon, PokemonResource>(result.Pokemon); return(Ok(pokemonResource)); }