public class Restaurants1
{
public string id { get; set; }
public string name { get; set; }
public string address { get; set; }
public string contact { get; set; }
public string links { get; set; }
public string about { get; set; }
public string info { get; set; }
public string image { get; set; }
public string lat { get; set; }
public string lng { get; set; }
public string currency { get; set; }
public string minprice { get; set; }
public string maxprice { get; set; }
public string facility { get; set; }
public string keywords { get; set; }
public string status { get; set; }
public string review_count { get; set; }
public string distance { get; set; }
public string menu_image { get; set; }
public string menu_resizead { get; set; }
}
public class Restaurants2
{
public string id { get; set; }
public string name { get; set; }
public string address { get; set; }
public string contact { get; set; }
public string links { get; set; }
public string about { get; set; }
public string info { get; set; }
public string image { get; set; }
public string lat { get; set; }
public string lng { get; set; }
public string currency { get; set; }
public string minprice { get; set; }
public string maxprice { get; set; }
public string facility { get; set; }
public string keywords { get; set; }
public string status { get; set; }
public string review_count { get; set; }
public string distance { get; set; }
public string menu_image { get; set; }
public string menu_resizead { get; set; }
}
public class Result
{
public List<Restaurants1> restaurants1 { get; set; }
public List<Restaurants2> restaurants2 { get; set; }
public bool no_featured { get; set; }
}
public class RootObject
{
public string status { get; set; }
public Result result { get; set; }
}
var url = e.UserState as Uri;
RootObject root = JsonConvert.DeserializeObject<RootObject>(e.Result);
MessageBox.Show("success");
RootObject root = JsonConvert.DeserializeObject<RootObject>(e.Result) is Error
like this :
错误 1 'Newtonsoft.Json.JsonConvert.DeserializeObject(string)' 的最佳重载方法匹配有一些无效参数 E:\parsingjson\parsingjson\MainPage.xaml.cs 103 30 parsingjson
为什么?
以及如何解决?