JArrayExtensions.GetObject method
| Namespace | Skybrud.Essentials.Json.Extensions |
|---|---|
| Assembly | Skybrud.Essentials.dll |
GetObject(JArray, int)
Gets an object from the item at the specified index in the array.
public static JObject GetObject(this JArray array, int index)
GetObject<T>(JArray, int)
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
Returns
T
An instance of T, or the default value of T if not
found.
GetObject<T>(JArray, int, Func<T, TResult>)
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.
The delegate (callback method) used for parsing the object.
Returns
T
An instance of T.
GetObject(JArray, string)
Gets an object from token matching the specified path.
public static JObject GetObject(this JArray array, string path)
GetObject<T>(JArray, string)
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
Returns
T
An instance of T, or the default value of T if not
found.
GetObject<T>(JArray, string, Func<T, TResult>)
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.
The delegate (callback method) used for parsing the object.
Returns
T
An instance of T.