JObjectExtension.GetArray method

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

GetArray(JObject, string)

Static

Gets an instance of JArray from the token matching the specified path.

public static JArray GetArray(JObject obj, string path)

Parameters

obj JObject

The instance of JObject .

path String

A String that contains a JPath expression.

Returns

An instance of JArray , or null if not found.

GetArray<T>(JObject, string, Func<T, TResult>)

Static

Gets an array of T from the property matching the specified path using the specified delegate callback for parsing each item in the array.

public static T[] GetArray<T>(JObject obj, string path, Func<T, TResult> callback)

Type Parameters

T

Parameters

obj JObject

The instance of JObject .

path String

A String that contains a JPath expression.

callback Func<T, TResult>

A callback function used for parsing or converting the token value.

Returns

Array of T