JObjectExtensions.GetInt16 method

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

GetInt16(JObject, string)

Extension method

Gets the Int16 value of the token matching the specified path, or 0 if path doesn't match a token.

public static Int16 GetInt16(this JObject obj, string path)

Parameters

obj JObject

The parent object.

path String

A String that contains a JPath expression.

Returns

An instance of Int16 .

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

Extension method

Gets the Int16 value of the token matching the specified path and parses it into an instance of T, or the default value of T if path doesn't match a token.

public static T GetInt16<T>(this JObject obj, string path, Func<T, TResult> callback)

Type Parameters

T

The type of the parsed type.

Parameters

obj JObject

The parent object.

path String

A String that contains a JPath expression.

callback Func<T, TResult>

The callback used for converting the integer value.

Returns

T

An instance of Int16 , or 0 if path doesn't match a token.