我想从xamarin的deserializedobject列表中获取id

时间:2017-10-22 00:33:59

标签: json list xamarin.forms json-deserialization getasync

var httpClient = new HttpClient();
var response = await httpClient.GetAsync("URL");

     if (response.StatusCode == HttpStatusCode.OK){
                var result = response.Content.ReadAsStringAsync().Result;

                if (result == "[]")
                {
                    await DisplayAlert("Invalid", "invalid", "Try Again");
                }
                else
                {
                    var name = JsonConvert.DeserializeObject<List<DemoClass>>(result);
      }
}

0 个答案:

没有答案