public async Task <ItemDetailsDTO> GetDetails(int id) { using (var httpClient = new HttpClient()) { var uri = new Uri(RestHelper.ApiUrl($"{ItemsApiEndpoint}/{id}/details")); var response = await httpClient.GetStringAsync(uri); return(JsonConvert.DeserializeObject <ItemDetailsDTO>(response)); } }
public async Task <ICollection <ItemDTO> > GetAll() { using (var httpClient = new HttpClient()) { var uri = new Uri(RestHelper.ApiUrl(ItemsApiEndpoint)); var response = await httpClient.GetStringAsync(uri); return(JsonConvert.DeserializeObject <ICollection <ItemDTO> >(response)); } }