Skip to main content

JProperty Class

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

A name/value pair inside a JObject.

public class JProperty : JToken

Constructors

JProperty()

public JProperty()

Initializes a new empty property.

JProperty(string name, JToken value)

public JProperty(string name, JToken value)

Initializes a new property with the given name and value.

Properties

Name

public string Name { get; set; }

Gets or sets the property name.

Value

public JToken Value { get; set; }

Gets or sets the property value.

Methods

ToString()

public override string ToString()

Returns the JSON text for this property.

Returns string

ToString(JsonSerializationOptions options)

public override string ToString(JsonSerializationOptions options)

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

Returns string

GetBsonSize()

public override int GetBsonSize()

Gets the number of bytes the property value occupies when encoded as BSON.

Returns int

GetBsonSize(string ename)

public override int GetBsonSize(string ename)

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

Returns int

ToBson(byte[] buffer, ref int offset)

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

Writes the property value to the buffer as BSON, advancing the offset.

GetBsonType()

public override BsonTypes GetBsonType()

Gets the BSON type code of the property value.

Returns BsonTypes