我怎麼能反序列化FF JSON字符串:反序列化返回空值
{"stock":[{"name":"stock1","price":{"currency":"AUD","amount":103.50},"percent_change":-1.33,"volume":1583760,"symbol":"SC1"}],"as_of":"2016-06-10T15:20:00+08:00"}
我已經試過代碼:
JsonConvert.DeserializeObject<stock>(content);
在內容變量是上面的JSON字符串。 但是我得到屬性的空值。
這裏是我的課:
public class price
{
public string currency { get; }
public double amount { get; }
}
public class stock
{
public string name { get; }
public price price { get; }
public double percent_change { get; }
public int volume { get; }
public string symbol { get; }
}
預先感謝您!
非常感謝好友,它的工作! – wuU