Converting one of the value of json to object

时间:2017-08-04 12:48:41

标签: javascript c# asp.net .net json

I have a json like this -

enter image description here

Now I want to convert all "value" (just value json array) to a list of class -

JavaScriptSerializer js = new JavaScriptSerializer();
var alluserdata = js.Deserialize<List<MyUserData>>(rawjson);

But alluserdata is always null.

1 个答案:

答案 0 :(得分:0)

Ok I got the answer - It should be like this -

var alluserdata = JObject.Parse(rawjson)["value"].ToObject<List<MyUserData>>();