Skip to main content

JObject Class

NuGet: GHIElectronics.TinyCLR.Data.Json
Assembly: GHIElectronics.TinyCLR.Data.Json
Namespace: GHIElectronics.TinyCLR.Data.Json

A JSON object — an unordered map of name/JToken pairs.

public class JObject : JToken

Properties

name]

public JProperty this[string name] { get; set; }

Gets or sets the property with the given name (case-insensitive).

Members

public ICollection Members { get; }

Gets the object's properties in insertion order.

Methods

Contains(string name)

public bool Contains(string name)

Returns whether the object contains a property with the given name.

Returns bool

Add(string name, JToken value)

public void Add(string name, JToken value)

Adds or replaces a property with the given name and value.

Serialize(Type type, object oSource, JsonSerializerSettings settings)

public static JObject Serialize(Type type, object oSource, JsonSerializerSettings settings = null)

Serializes a .NET object's public properties and fields into a JSON object.

Returns JObject

ToString()

public override string ToString()

Returns the JSON text for this object.

Returns string

ToString(JsonSerializationOptions options)

public override string ToString(JsonSerializationOptions options)

Returns the JSON text for this object using the given formatting options.

Returns string

GetBsonSize()

public override int GetBsonSize()

Gets the number of bytes this object occupies when encoded as BSON.

Returns int

GetBsonSize(string ename)

public override int GetBsonSize(string ename)

Gets the number of BSON bytes for this object including the given element name.

Returns int

ToBson(byte[] buffer, ref int offset)

public override void ToBson(byte[] buffer, ref int offset)

Writes this object to the buffer as BSON, advancing the offset.

GetBsonType()

public override BsonTypes GetBsonType()

Gets the BSON type code for a document (object).

Returns BsonTypes