JArrayExtensions.GetObject method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Json.Extensions
Assembly Skybrud.Essentials.dll

GetObject(JArray, int)

Extension method

Gets an object from the item at the specified index in the array.

public static JObject GetObject(this JArray array, int index)

Parameters

array JArray

The parent array.

index int

The index of the item.

Returns

An instance of JObject , or null if not found.

GetObject<T>(JArray, int)

Extension method

Gets an object from the item at the specified index in the array. If an object is found, it is parsed to the type of T.

public static T GetObject<T>(this JArray array, int index)

Type Parameters

T

Parameters

array JArray

The parent array.

index int

The index of the item.

Returns

T

An instance of T, or the default value of T if not found.

GetObject<T>(JArray, int, Func<T, TResult>)

Extension method

Gets an object from the item at the specified index in the array. If an object is found, the object is parsed using the specified delegate func.

public static T GetObject<T>(this JArray array, int index, Func<T, TResult> func)

Type Parameters

T

Parameters

array JArray

The parent array.

index int

The index of the item.

func Func<T, TResult>

The delegate (callback method) used for parsing the object.

Returns

T

An instance of T.

GetObject(JArray, string)

Extension method

Gets an object from token matching the specified path.

public static JObject GetObject(this JArray array, string path)

Parameters

array JArray

The parent array.

path String

A String that contains a JPath expression.

Returns

An instance of JObject , or null if not found.

GetObject<T>(JArray, string)

Extension method

Gets an object from token matching the specified path. If an object is found, it is parsed to the type of T.

public static T GetObject<T>(this JArray array, string path)

Type Parameters

T

Parameters

array JArray

The parent array.

path String

A String that contains a JPath expression.

Returns

T

An instance of T, or the default value of T if not found.

GetObject<T>(JArray, string, Func<T, TResult>)

Extension method

Gets an object from token matching the specified path. If an object is found, the object is parsed using the specified delegate func.

public static T GetObject<T>(this JArray array, string path, Func<T, TResult> func)

Type Parameters

T

Parameters

array JArray

The parent array.

path String

A String that contains a JPath expression.

func Func<T, TResult>

The delegate (callback method) used for parsing the object.

Returns

T

An instance of T.