JSON
Namespace: System
Assembly: Wisej.Framework (4.1.0.0)
Provides JSON serialization and parsing functionality and extends every Object with the ToJSON methods.
- C#
- VB.NET
public static class JSON
Public Class JSON
Methods
Parse(json)
Parses a JSON string to a dynamic object, similar to a JavaScript "expando" object.
| Parameter | Type | Description |
|---|---|---|
| json | String | The JSON string to parse. |
Returns: Object. 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.
Returns: Object. 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 | Object | The object to serialize. |
| formatted | Boolean | True to format the output JSON string. |
Returns: String. A String representing the serialized object.
Stringify(obj, options)
Serializes the object to a JSON string.
| Parameter | Type | Description |
|---|---|---|
| obj | Object | The object to serialize. |
| options | WisejSerializerOptions | A combination of WisejSerializerOptions flags. |
Returns: String. A String representing the serialized object.
ToJSON(obj, formatted)
Serializes the object to a JSON string.
| Parameter | Type | Description |
|---|---|---|
| obj | Object | The object to serialize. |
| formatted | Boolean | True to format the output JSON string. |
Returns: String. A String representing the serialized object.
ToJSON(obj, options)
Serializes the object to a JSON string.
| Parameter | Type | Description |
|---|---|---|
| obj | Object | The object to serialize. |
| options | WisejSerializerOptions | A combination of WisejSerializerOptions flags. |
Returns: String. A String representing the serialized object.