Table of Contents

Class JProperty

Namespace
Newtonsoft.Json.Linq
Assembly
Newtonsoft.Json.dll

Represents a JSON property.

public class JProperty : JContainer, IJEnumerable<JToken>, IJsonLineInfo, ICloneable, IList<JToken>, ICollection<JToken>, IEnumerable<JToken>, ITypedList, IBindingList, IList, ICollection, IEnumerable
Inheritance
JProperty
Implements
Inherited Members
Extension Methods

Constructors

JProperty(JProperty)

Initializes a new instance of the JProperty class from another JProperty object.

public JProperty(JProperty other)

Parameters

other JProperty

A JProperty object to copy from.

JProperty(string, object)

Initializes a new instance of the JProperty class.

public JProperty(string name, object content)

Parameters

name string

The property name.

content object

The property content.

JProperty(string, params object[])

Initializes a new instance of the JProperty class.

public JProperty(string name, params object[] content)

Parameters

name string

The property name.

content object[]

The property content.

Properties

ChildrenTokens

Gets the container's children tokens.

protected override IList<JToken> ChildrenTokens { get; }

Property Value

IList<JToken>

The container's children tokens.

Name

Gets the property name.

public string Name { get; }

Property Value

string

The property name.

Type

Gets the node type for this JToken.

public override JTokenType Type { get; }

Property Value

JTokenType

The type.

Value

Gets or sets the property value.

public JToken Value { get; set; }

Property Value

JToken

The property value.

Methods

Load(JsonReader)

Loads an JProperty from a JsonReader.

public static JProperty Load(JsonReader reader)

Parameters

reader JsonReader

A JsonReader that will be read for the content of the JProperty.

Returns

JProperty

A JProperty that contains the JSON that was read from the specified JsonReader.

WriteTo(JsonWriter, params JsonConverter[])

Writes this token to a JsonWriter.

public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)

Parameters

writer JsonWriter

A JsonWriter into which this method will write.

converters JsonConverter[]

A collection of JsonConverter which will be used when writing the token.