猿问

如何在 mvc C# 中使用 newtonsoft 反序列化嵌套的 json 字符串

我一直在尝试反序列化嵌套的 json。我正在从世界银行 api获取 JSON 。我想country id从 JSON 和值中获取绑定到下拉列表中的值。


我不确定,怎么了?


反序列化的附加信息代码


JObject googleSearch = JObject.Parse(googleSearchText);


// get JSON result objects into a list IList<JToken> results =

googleSearch["responseData"]["results"].Children().ToList();


// serialize JSON results into .NET objects IList<SearchResult>

searchResults = new List<SearchResult>(); foreach (JToken result in results) {

// JToken.ToObject is a helper method that uses JsonSerializer internally

SearchResult searchResult = result.ToObject<SearchResult>();

searchResults.Add(searchResult); }

鉴于下面的代码。这是我的模型:


Using Newtonsoft.Json;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;


    namespace ejemplo.Models

   {

    public class Paginacion

    {

        public Paginacion()

        {

            this.List = new List<Data>();

        }


        [JsonProperty("page")]

        public int Page { get; set; }


        [JsonProperty("pages")]

        public int Pages { get; set; }


        [JsonProperty("per_page")]

        public string PerPage { get; set; }


        [JsonProperty("total")]

        public int Total { get; set; }


        public List<Data> List { get; set; }

    }


    public class Country

    {

        [JsonProperty("id")]

        public string Id { get; set; }


        [JsonProperty("value")]

        public string Value { get; set; }

    }


    public class Indicator

    {

        [JsonProperty("id")]

        public string Id { get; set; }


        [JsonProperty("value")]

        public string Value { get; set; }

    }


public class Data

{

    public Data()

    {

        this.Indicator = new Indicator();

        this.Country = new Country();

    }


    [JsonProperty("indicator")]

    public Indicator Indicator { get; set; }


    [JsonProperty("country")]

    public Country Country { get; set; }


    [JsonProperty("date")]

    public string Date { get; set; }


    [JsonProperty("value")]

    public string Value { get; set; }


    [JsonProperty("decimal")]

    public string Decimal { get; set; }


   }

}


杨__羊羊
浏览 200回答 2
2回答

米琪卡哇伊

你的 json 是一个数组所以你需要使用 JArroy.Parse 而不是 JObject.Parse代替JObject googleSearch = JObject.Parse(googleSearchText);为了JArray googleSearch = JArray.Parse(googleSearchText);然后您可以导航 de JArray 以查找您的值。// get JSON result objects into a list IList<JToken> results =var results = googleSearch.Last.ToList();// serialize JSON results into .NET objects IList<SearchResult>List<Country> countyList = new List<Country>();foreach (JToken result in results){&nbsp; &nbsp; // JToken.ToObject is a helper method that uses JsonSerializer internally&nbsp; &nbsp; var country = new Country { Id = result["id"].ToString(), Value = result["name"].ToString() };&nbsp; &nbsp; countyList.Add(country);}

慕容森

虽然它是有效的 json,但序列化器需要一个根对象,因此如果您可以将 json 输出修改为根对象,您就可以正确地序列化它:[&nbsp;&nbsp;&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp;"page": {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "page":1,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "pages":31,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "per_page":"10",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "total":304&nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp;"data": [&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"ABW",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"AW",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Aruba",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LCN",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"ZJ",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Latin America & Caribbean "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"HIC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XD",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"High income"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LNX",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XX",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Not classified"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"Oranjestad",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"-70.0167",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":"12.5167"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"AFG",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"AF",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Afghanistan",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"SAS",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"8S",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"South Asia"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"SAS",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"8S",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"South Asia"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LIC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XM",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Low income"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"IDX",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XI",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"IDA"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"Kabul",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"69.1761",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":"34.5228"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"AFR",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"A9",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Africa",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"AGO",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"AO",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Angola",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"SSF",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"ZG",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Sub-Saharan Africa "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"SSA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"ZF",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Sub-Saharan Africa (excluding high income)"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LMC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XN",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Lower middle income"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"IBD",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XF",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"IBRD"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"Luanda",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"13.242",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":"-8.81155"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"ALB",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"AL",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Albania",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"ECS",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"Z7",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Europe & Central Asia"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"ECA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"7E",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Europe & Central Asia (excluding high income)"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"UMC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XT",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Upper middle income"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"IBD",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XF",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"IBRD"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"Tirane",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"19.8172",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":"41.3317"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"AND",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"AD",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Andorra",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"ECS",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"Z7",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Europe & Central Asia"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"HIC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XD",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"High income"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LNX",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XX",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Not classified"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"Andorra la Vella",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"1.5218",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":"42.5075"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"ANR",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"L5",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Andean Region",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"ARB",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"1A",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Arab World",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"NA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Aggregates"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"ARE",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"AE",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"United Arab Emirates",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"MEA",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"ZQ",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Middle East & North Africa"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":""&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"HIC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XD",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"High income"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LNX",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XX",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Not classified"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"Abu Dhabi",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"54.3705",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":"24.4764"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"id":"ARG",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"iso2Code":"AR",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name":"Argentina",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"region":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LCN",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"ZJ",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Latin America & Caribbean "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"adminregion":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"LAC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XJ",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Latin America & Caribbean (excluding high income)"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"incomeLevel":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"UMC",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XT",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"Upper middle income"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"lendingType":{&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "id":"IBD",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "iso2code":"XF",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "value":"IBRD"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"capitalCity":"Buenos Aires",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"longitude":"-58.4173",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"latitude":"-34.6118"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp;]&nbsp; &nbsp; }]课程:public class RootObject{&nbsp; &nbsp; public Page page { get; set; }&nbsp; &nbsp; public List<Datum> data { get; set; }}public class Page{&nbsp; &nbsp; public int page { get; set; }&nbsp; &nbsp; public int pages { get; set; }&nbsp; &nbsp; public string per_page { get; set; }&nbsp; &nbsp; public int total { get; set; }}
随时随地看视频慕课网APP
我要回答