Converting one of the value of json to object

Anil Purswani

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.

Anil Purswani

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

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

iOS - Decimal Value Changed After Converting a JSON String Into a JSON Object

From Dev

json string is not converting into object

From Dev

Json object converting error

From Dev

Converting Nhibernate Object to JSON

From Dev

Converting JSON string into object

From Dev

Converting JSON to an Object

From Dev

Converting JSON object to dictionary

From Dev

Converting the javascript object to json object

From Dev

Converting JSON object to dynamic object

From Dev

Converting the javascript object to json object

From Dev

converting json object in to another object

From Dev

Converting Json object to Java object

From Dev

Converting object of a class to of another one

From Dev

Converting str object of list to one list object

From Dev

Converting PHP Associative array to JSON object - spaces in value results in malformed JSON

From Dev

converting R dataframes to json object

From Dev

Converting JSON object to javascript array

From Dev

Converting Map<String, Object> to json

From Dev

Converting PHP Array to Json Object

From Dev

Converting JSON/JS Object to array

From Dev

Converting string to a valid JSON object

From Dev

Converting JavaScript Array to JSON object

From Dev

Error while Converting to Json Object

From Dev

Android: JSON not converting object properly

From Dev

Converting JSON object to javascript array

From Dev

Converting the Database details to JSON object

From Dev

Json Object to PHP array - not converting

From Dev

Converting Class object to Json for WebService

From Dev

converting R dataframes to json object