If you look at the documentation for JObject
, you will see that it implements IEnumerable<KeyValuePair<string, JToken>>
. So, you can iterate over it simply using a foreach
:
foreach (var x in obj)
{
string name = x.Key;
JToken value = x.Value;
…
}
More Related Contents:
- How can I parse JSON with C#?
- Deserializing JSON data to C# using JSON.NET
- Can I specify a path in an attribute to map a property in my class to a child property in my JSON?
- “Self Referencing Loop Detected” exception with JSON.Net
- Unexpected character encountered while parsing value
- Deserialize json array stream one item at a time
- Order of serialized fields using JSON.NET
- Json.NET serialize object with root name
- How to Deserialize JSON data?
- Why are some members missing when trying to print an object by serializing to JSON?
- Cannot deserialize JSON array into type – Json.NET
- How to apply indenting serialization only to some properties?
- How to apply ObjectCreationHandling.Replace to selected properties when deserializing JSON?
- DateTime column type becomes String type after deserializing DataTable
- Modify existing object with new partial JSON data using Json.NET
- Accessing properties with a dot in their name
- Deserialize json object with dynamic items in C#
- Json.NET JSONPath query not returning expected results
- JSON.NET serialize JObject while ignoring null properties
- Force JsonConvert.SerializeXmlNode to serialize node value as an Integer or a Boolean
- JSON.Net Xml Serialization misunderstands arrays
- How do C# classes deal with dollar signs in JSON?
- How to convert c# generic list to json using json.net?
- JSON Deserialization – String Is Automatically Converted To Int
- Json.net rename properties
- Configure Json.NET serialization settings on a class level
- Newtonsoft JSON for .net is ignoring jsonproperty tags
- JSON.NET Serializes Empty JSON
- How to convert JSON to XML or XML to JSON in C#?
- SignalR Typenamehandling