Skip to main content
Version: 4.1

JSON

Namespace: System

Assembly: Wisej.Framework (4.1.0.0)

Provides JSON serialization and parsing functionality and extends every Object with the ToJSON methods.

public static class JSON

Methods​

Static member Parse(json)​

Parses a JSON string to a dynamic object, similar to a JavaScript "expando" object.

ParameterTypeDescription
jsonStringThe JSON string to parse.

Returns: Object. An instance of DynamicObject containing all the values parsed from the json string.

Static member Parse(stream)​

Parses a JSON string to a dynamic object, similar to a JavaScript "expando" object.

ParameterTypeDescription
streamStreamA Stream providing the JSON string to parse.

Returns: Object. An instance of DynamicObject containing all the values parsed from the stream stream.

Static member Stringify(obj, formatted)​

Serializes the object to a JSON string.

ParameterTypeDescription
objObjectThe object to serialize.
formatted optionalBooleanTrue to format the output JSON string.

Returns: String. A String representing the serialized object.

Static member Stringify(obj, options)​

Serializes the object to a JSON string.

ParameterTypeDescription
objObjectThe object to serialize.
optionsWisejSerializerOptionsA combination of WisejSerializerOptions flags.

Returns: String. A String representing the serialized object.

Static member ToJSON(obj, formatted)​

Serializes the object to a JSON string.

ParameterTypeDescription
objObjectThe object to serialize.
formatted optionalBooleanTrue to format the output JSON string.

Returns: String. A String representing the serialized object.

Static member ToJSON(obj, options)​

Serializes the object to a JSON string.

ParameterTypeDescription
objObjectThe object to serialize.
optionsWisejSerializerOptionsA combination of WisejSerializerOptions flags.

Returns: String. A String representing the serialized object.