Home > DeveloperSection > Forums > Can Json.Net handle a List<object>?
Royce Roy
Royce Roy

Total Post:146

Points:1022
Posted on    January-28-2014 11:54 PM

 C# C# 
Ratings:


 1 Reply(s)
 1522  View(s)
Rate this:

List<User> list = LoadUsers();

JObject json = new JObject();

json["users"] = new JValue(list);

Doesn't seem to be working?

Error:

Could not determine JSON object type for type System.Collections.Generic.List



Pravesh Singh

Total Post:412

Points:2888
Posted on    January-29-2014 12:51 AM

Hi Royce,

This might help:

json["users"] = new JValue(JsonConvert.SerializeObject(list));


Don't want to miss updates? Please click the below button!

Follow MindStick