deserialize नहीं होगा मैं एक json प्रतिक्रिया वापस वस्तुओं में चारsquare से बदलने की कोशिश कर रहा हूँ। मैं कुछ इस तरह वापसमुझे क्या याद आ रही है? RestSharp जेसन
{
"meta":{
"code":200
},
"response":{
"venues":[
{
"id":"4abfb58ef964a520be9120e3",
"name":"Costco",
"contact":{
"phone":"6045967435",
"formattedPhone":"(604) 596-7435"
},
"location":{
"address":"7423 King George Hwy",
"crossStreet":"btw 76 Avenue & 73A Avenue",
"lat":49.138259617056015,
"lng":-122.84723281860352,
"distance":19000,
"postalCode":"V3W 5A8",
"city":"Surrey",
"state":"BC",
"country":"Canada",
"cc":"CA"
},
"canonicalUrl":"https:\/\/foursquare.com\/v\/costco\/4abfb58ef964a520be9120e3",
"categories":[
{
"id":"4bf58dd8d48988d1f6941735",
"name":"Department Store",
"pluralName":"Department Stores",
"shortName":"Department Store",
"icon":{
"prefix":"https:\/\/foursquare.com\/img\/categories_v2\/shops\/departmentstore_",
"suffix":".png"
},
"primary":true
}
],
"verified":true,
"restricted":true,
"stats":{
"checkinsCount":2038,
"usersCount":533,
"tipCount":12
},
"url":"http:\/\/www.costco.ca",
"specials":{
"count":0,
"items":[
]
},
"hereNow":{
"count":0,
"groups":[
]
},
"referralId":"v-1366316196"
}
]
}
}
मिल रहा फिर भी Venues
इस
public class Response
{
public string Meta { get; set; }
public List<Venue> Venues { get; set; }
}
public class Venue
{
public string Id { get; set; }
public string Name { get; set; }
public Contact Contact { get; set; }
public Location Location { get; set; }
public string CanonicalUrl { get; set; }
public Categories Categories { get; set; }
public bool Verified { get; set; }
}
var response = client.Execute<Response>(request);
var test = response.Data;
की तरह एक वर्ग बनाया हमेशा रिक्त है। मुझे यकीन नहीं है कि क्यों।
chobo2, आपका जेसन अवैध है और फ़ील्ड के बीच कई कॉमा गायब है। तो RetSharp सही है। – I4V
मान लें कि जेसन मान्य है। यह चौकोर से आ रहा है (इसे काम करना चाहिए ....)। जिस समस्या का आप वर्णन कर रहे हैं वह इसलिए था क्योंकि मैंने इसे अपने लाइव टूल से कॉपी किया जो स्पष्ट रूप से उद्धरणों को स्ट्रिप्स करता है ... कोड के माध्यम से अनुरोध उद्धरण है। – chobo2