【发布时间】:2020-02-11 14:39:44
【问题描述】:
string sampleString = "[{\"id\":\"1\",\"status\":302},{\"id\":\"2\",\"status\":302},{\"id\":\"3\",\"status\":302},{\"id\":\"4\",\"status\":302}]";
JArray json = JArray.Parse(sampleString );
TempValue t;
foreach(JObject obj in json)
{
t = new TempValue {
id =//id of json,
status=//state of json
};
}
我想访问 json 匿名对象的值以分配给 t 对象。
【问题讨论】:
-
这能回答你的问题吗? Deserialize JSON into Object C#
标签: c# .net-core types anonymous-types