Show / Hide Table of Contents

Class JsonObjectExtensions

Provides extension methods for JsonValues.

Inheritance
System.Object
JsonObjectExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Manatee.Json
Assembly: Manatee.Json.dll
Syntax
public static class JsonObjectExtensions

Methods

| Improve this Doc View Source

TryGetArray(JsonObject, String)

Returns a JsonArray or null if the key is not found or is not a JsonArray.

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

| Improve this Doc View Source

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>

| Improve this Doc View Source

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>

| Improve this Doc View Source

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

| Improve this Doc View Source

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

  • Improve this Doc
  • View Source
Back to top Generated by DocFX