Esempio n. 1
0
        public async Task <List <StarWarCharacter> > Search(string query)
        {
            SwapiCollectionResponse response = await _httpClient.GetFromJsonAsync <SwapiCollectionResponse>($"/api/people/?search={query}");

            return(_mapper.Map <List <SwapiCharacter>, List <StarWarCharacter> >(response.Results));
        }
Esempio n. 2
0
        public async Task <List <StarWarCharacter> > GetPeople()
        {
            SwapiCollectionResponse response = await _httpClient.GetFromJsonAsync <SwapiCollectionResponse>("/api/people/");

            return(_mapper.Map <List <SwapiCharacter>, List <StarWarCharacter> >(response.Results));
        }