JSON

System.JSON

Namespace: System

Assembly: Wisej.Framework (2.5.0.0)

Provides JSON serialization and parsing functionality and extends every Objectarrow-up-right with the ToJSONarrow-up-right methods.

public class JSON
circle-info

In Visual Basic and C#, you can call this method as an instance method on any object of type Objectarrow-up-right. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic)arrow-up-right or Extension Methods (C# Programming Guide)arrow-up-right.

Methods

Parse(json)

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

Parameter
Type
Description

json

The JSON string to parse.

Returns: Objectarrow-up-right. An instance of DynamicObject containing all the values parsed from the json string.

Parse(stream)

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

Parameter
Type
Description

stream

A Streamarrow-up-right providing the JSON string to parse.

Returns: Objectarrow-up-right. An instance of DynamicObject containing all the values parsed from the stream stream.

Stringify(obj, formatted)

Serializes the object to a JSON string.

Parameter
Type
Description

obj

The object to serialize.

formatted

True to format the output JSON string.

Returns: Stringarrow-up-right. A Stringarrow-up-right representing the serialized object.

Stringify(obj, options)

Serializes the object to a JSON string.

Parameter
Type
Description

obj

The object to serialize.

options

A combination of WisejSerializerOptions flags.

Returns: Stringarrow-up-right. A Stringarrow-up-right representing the serialized object.

ToJSON(obj, formatted)

Serializes the object to a JSON string.

Parameter
Type
Description

obj

The object to serialize.

formatted

True to format the output JSON string.

Returns: Stringarrow-up-right. A Stringarrow-up-right representing the serialized object.

ToJSON(obj, options)

Serializes the object to a JSON string.

Parameter
Type
Description

obj

The object to serialize.

options

A combination of WisejSerializerOptions flags.

Returns: Stringarrow-up-right. A Stringarrow-up-right representing the serialized object.

Last updated

Was this helpful?