I'm using JSON.NET Linq to JSON, when I execute the below I get the following argument exception:
Can not add Newtonsoft.Json.Linq.JValue to Newtonsoft.Json.Linq.JObject
What's wrong with the code
string content = new JObject(
new JObject("auth",
new JProperty("user", "[email protected]"),
new JProperty("secret", "somepassword")
),
new JObject("config",
new JProperty("template", "1")
),
new JObject("data",
new JProperty("email", "body")
)
).ToString();
XDocument
andXElement
where you can mix the node name and its child nodes in the parameter list. – fero Oct 29 '12 at 12:48