Class JsonObjectExtensions
Provides extension methods for JsonValues.
Inheritance
Inherited Members
Namespace: Manatee.Json
Assembly: Manatee.Json.dll
Syntax
public static class JsonObjectExtensions
Methods
| Improve this Doc View SourceTryGetArray(JsonObject, String)
Declaration
public static JsonArray? TryGetArray(this JsonObject obj, string key)
Parameters
Type | Name | Description |
---|---|---|
JsonObject | obj | The JsonObject to search |
System.String | key | The key |
Returns
Type | Description |
---|---|
System.Nullable<JsonArray> | A JsonArray or null if the key is not found or is not a JsonArray |
TryGetBoolean(JsonObject, String)
Returns a System.Nullable<T> or null if the key is not found or is not a System.Boolean.
Declaration
public static bool? TryGetBoolean(this JsonObject obj, string key)
Parameters
Type | Name | Description |
---|---|---|
JsonObject | obj | The JsonObject to search |
System.String | key | The key |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> | A System.Nullable<T> or null if the key is not found or is not a System.Nullable<T> |
TryGetNumber(JsonObject, String)
Returns a System.Nullable<T> or null if the key is not found or is not a double.
Declaration
public static double? TryGetNumber(this JsonObject obj, string key)
Parameters
Type | Name | Description |
---|---|---|
JsonObject | obj | The JsonObject to search |
System.String | key | The key |
Returns
Type | Description |
---|---|
System.Nullable<System.Double> | A System.Nullable<T> or null if the key is not found or is not a System.Nullable<T> |
TryGetObject(JsonObject, String)
Returns a JsonObject or null if the key is not found or is not a JsonObject.
Declaration
public static JsonObject? TryGetObject(this JsonObject obj, string key)
Parameters
Type | Name | Description |
---|---|---|
JsonObject | obj | The JsonObject to search |
System.String | key | The key |
Returns
Type | Description |
---|---|
System.Nullable<JsonObject> | A JsonObject or null if the key is not found or is not a JsonObject |
TryGetString(JsonObject, String)
Returns a System.String or null if the key is not found or is not a System.String.
Declaration
public static string? TryGetString(this JsonObject obj, string key)
Parameters
Type | Name | Description |
---|---|---|
JsonObject | obj | The JsonObject to search |
System.String | key | The key |
Returns
Type | Description |
---|---|
System.Nullable<System.String> | A System.String or null if the key is not found or is not a System.String |