private async Task AdicionaResponseAListaAsync() { foreach (var item in swapiResponse.results) { item.HomeWorldName = new PlanetaDTO { name = await _planeta.ObterHomeWorld(item.homeworld) }; especies.Add(item); } }
private async Task AdicionaResponseAListaAsync(List <PersonagemDTO> results) { foreach (var item in results) { item.HomeWorldName = new PlanetaDTO { name = await _planeta.ObterHomeWorld(item.homeworld) }; item.Especie = item.species.Count() > 0 ? new EspecieDTO { name = await _especie.ObterPorId(item.species[0]) } : new EspecieDTO { name = "" }; personagemCompleto.Add(item); } }