using Newtonsoft.Json.Linq; JObject person = new JObject(); person.Add("name", "John");
using Newtonsoft.Json.Linq; JObject person = new JObject(); person.Add("age", 30);
using Newtonsoft.Json.Linq; JObject person = new JObject(); JObject address = new JObject(); address.Add("street", "123 Main St"); address.Add("city", "New York"); address.Add("state", "NY"); person.Add("address", address);In this example, a nested JObject representing an address is created, filled with properties and added as a property value to the main JObject representing a person. Note: JObject is a class in the Newtonsoft.Json.Linq namespace.