JObjectExtensions.GetArray method

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

GetArray(JObject, string)

Extension method

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

public static JArray GetArray(this 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>)

Extension method

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

public static T[] GetArray<T>(this 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