JObjectExtensions.GetObject method

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

GetObject(JObject, string)

Extension method

Gets an object from a token matching the specified path.

public static JObject GetObject(this JObject obj, string path)

Parameters

obj JObject

The parent object.

path String

A String that contains a JPath expression.

Returns

An instance of JObject , or null if not found.

GetObject<T>(JObject, string)

Extension method

Gets an object from a token matching the specified path.

public static T GetObject<T>(this JObject obj, string path)

Type Parameters

T

Parameters

obj JObject

The parent object.

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>(JObject, string, Func<T, TResult>)

Extension method

Gets an object from a token matching the specified path.

public static T GetObject<T>(this JObject obj, string path, Func<T, TResult> func)

Type Parameters

T

Parameters

obj JObject

The parent object.

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, or the default value of T if not found.