public async Task <Planet> GetPlanet(string url) { var hc = new HttpCaller <Planet>(_client); var result = await hc.CallGetAsync(url); return(result); }
public async Task <Species> GetSpecies(string url) { var hc = new HttpCaller <Species>(_client); var result = await hc.CallGetAsync(url); return(result); }
public async Task <Vehicle> GetVehicle(string url) { var hc = new HttpCaller <Vehicle>(_client); var result = await hc.CallGetAsync(url); return(result); }
public async Task <Starship> GetStarship(string url) { var hc = new HttpCaller <Starship>(_client); var result = await hc.CallGetAsync(url); return(result); }
public async Task <Movie> GetMovie(int Id) { Movie result; var hc = new HttpCaller <Movie>(_client); try { result = await hc.CallGetAsync(string.Format("https://swapi.dev/api/films/{0}/", Id.ToString())); } catch (Exception ex) { _logger.LogError(ex, "Swapi Service issue"); throw; } return(result); }
public async Task <IEnumerable <Movie> > GetMovies() { SWAPITypeList <Movie> result; var hc = new HttpCaller <SWAPITypeList <Movie> >(_client); try { result = await hc.CallGetAsync("https://swapi.dev/api/films/"); } catch (Exception ex) { _logger.LogError(ex, "Swapi Service issue"); throw; } return(result.results); }