Struct JsonAny
A JSON object, list, number, or string.
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Assembly: SlugBase.dll
Syntax
public readonly struct JsonAny
Properties
Type
The type of this element.
Declaration
public readonly JsonAny.Element Type { get; }
Property Value
Methods
AsBool()
Declaration
public readonly bool AsBool()
Returns
Type |
Description |
System.Boolean |
|
Exceptions
AsBool(JsonAny)
Declaration
public static bool AsBool(JsonAny json)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Exceptions
AsDouble()
Declaration
public readonly double AsDouble()
Returns
Type |
Description |
System.Double |
|
Exceptions
AsDouble(JsonAny)
Declaration
public static double AsDouble(JsonAny json)
Parameters
Returns
Type |
Description |
System.Double |
|
Exceptions
AsFloat()
Declaration
public readonly float AsFloat()
Returns
Type |
Description |
System.Single |
|
Exceptions
AsFloat(JsonAny)
Declaration
public static float AsFloat(JsonAny json)
Parameters
Returns
Type |
Description |
System.Single |
|
Exceptions
AsInt()
Declaration
public readonly int AsInt()
Returns
Type |
Description |
System.Int32 |
|
Exceptions
AsInt(JsonAny)
Declaration
public static int AsInt(JsonAny json)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Exceptions
AsList()
Declaration
public readonly JsonList AsList()
Returns
Exceptions
AsList(JsonAny)
Declaration
public static JsonList AsList(JsonAny json)
Parameters
Returns
Exceptions
AsLong()
Declaration
public readonly long AsLong()
Returns
Type |
Description |
System.Int64 |
|
Exceptions
AsLong(JsonAny)
Declaration
public static long AsLong(JsonAny json)
Parameters
Returns
Type |
Description |
System.Int64 |
|
Exceptions
AsObject()
Declaration
public readonly JsonObject AsObject()
Returns
Exceptions
AsObject(JsonAny)
Declaration
public static JsonObject AsObject(JsonAny json)
Parameters
Returns
Exceptions
AsString()
Declaration
public readonly string AsString()
Returns
Type |
Description |
System.String |
|
Exceptions
AsString(JsonAny)
Declaration
public static string AsString(JsonAny json)
Parameters
Returns
Type |
Description |
System.String |
|
Exceptions
IsNull()
Test if this value is null
.
Declaration
public readonly bool IsNull()
Returns
Type |
Description |
System.Boolean |
|
Parse(String)
Declaration
public static JsonAny Parse(string data)
Parameters
Type |
Name |
Description |
System.String |
data |
The JSON text.
|
Returns
Exceptions
TryBool()
Try casting to System.String, returning null
on failure.
Declaration
public readonly bool? TryBool()
Returns
Type |
Description |
System.Nullable<System.Boolean> |
|
TryDouble()
Try casting to System.Double, returning null
on failure.
Declaration
public readonly double? TryDouble()
Returns
Type |
Description |
System.Nullable<System.Double> |
|
TryFloat()
Try casting to System.Single, returning null
on failure.
Declaration
public readonly float? TryFloat()
Returns
Type |
Description |
System.Nullable<System.Single> |
|
TryInt()
Try casting to System.Int32, returning null
on failure.
Declaration
public readonly int? TryInt()
Returns
Type |
Description |
System.Nullable<System.Int32> |
|
TryList()
Try casting to JsonList, returning null
on failure.
Declaration
public readonly JsonList? TryList()
Returns
Type |
Description |
System.Nullable<JsonList> |
|
TryLong()
Try casting to System.Int64, returning null
on failure.
Declaration
public readonly long? TryLong()
Returns
Type |
Description |
System.Nullable<System.Int64> |
|
TryObject()
Try casting to JsonObject, returning null
on failure.
Declaration
public readonly JsonObject? TryObject()
Returns
TryString()
Try casting to System.String, returning null
on failure.
Declaration
public readonly string TryString()
Returns
Type |
Description |
System.String |
|