JsonNodeItem(Int32) Property

Alternative to using the Children collection when the node is of type Array, that gets a child node keyed on its array index.

Definition

Namespace: MichaelBrooks.UK.Json
Assembly: JsonDOM (in JsonDOM.dll) Version: 1.0.7
C#
public JsonNode this[
	int index
] { get; }

Parameters

index  Int32
 

Property Value

JsonNode

Remarks

The existence of the Children property plus this property and its keyed equivalent is a very deliberate contravention of Occam's Razor in order to simplify the calling code in most circumstances. This property and the ItemString property can be used in chains to effectively support the bracketed notation form of JSONPath for navigating the parse tree. This property only supports the get operation. If you wish to add a new child node to the parent object, you must do so via the Children collection.
Online page.

Exceptions

InvalidOperationExceptionThrown when this node is not of type Array.
IndexOutOfRangeExceptionThrown when index value is invalid.

See Also