private void AppendMagazinesByCategory(string category) { string endpoint = String.Format("api/magazines/{0}/{1}", this.Token, category); MagazineResponse response = JsonConvert.DeserializeObject <MagazineResponse>(this.ExecuteGet(endpoint)); this.ValidateResponse(response, endpoint); this.Magazines.AddRange(response.data); }
/// <summary> /// Asynchronous call to get a magazine list for a single category. /// </summary> /// <param name="httpClient"></param> /// <param name="magazineRequest"></param> /// <returns></returns> private static async Task GetMagazineListForCategoryAsync(HttpClient httpClient, string magazineRequest) { string magazineResponse = await httpClient.GetStringAsync(magazineRequest); MagazineResponse magazines = (MagazineResponse)JsonConvert.DeserializeObject(magazineResponse, typeof(MagazineResponse)); fullMagazineList.AddRange(magazines.data); }