Class JSONExtensions
Provides JSON extension methods
Inheritance
System.Object
JSONExtensions
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: Azos.Serialization.JSON
Assembly: Azos.dll
Syntax
public static class JSONExtensions
Methods
JSONToDataObject(ISourceText, Boolean)
Deserializes JSON content into IJSONDataObject
Declaration
public static IJSONDataObject JSONToDataObject(this ISourceText json, bool caseSensitiveMaps = true)
Parameters
Type | Name | Description |
---|---|---|
ISourceText | json | |
System.Boolean | caseSensitiveMaps |
Returns
Type | Description |
---|---|
IJSONDataObject |
JSONToDataObject(Stream, Encoding, Boolean)
Deserializes JSON content into IJSONDataObject
Declaration
public static IJSONDataObject JSONToDataObject(this Stream json, Encoding encoding = null, bool caseSensitiveMaps = true)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | json | |
System.Text.Encoding | encoding | |
System.Boolean | caseSensitiveMaps |
Returns
Type | Description |
---|---|
IJSONDataObject |
JSONToDataObject(String, Boolean)
Deserializes JSON content into IJSONDataObject
Declaration
public static IJSONDataObject JSONToDataObject(this string json, bool caseSensitiveMaps = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | |
System.Boolean | caseSensitiveMaps |
Returns
Type | Description |
---|---|
IJSONDataObject |
JSONToDynamic(ISourceText, Boolean)
Deserializes JSON content into dynamic JSON object
Declaration
public static dynamic JSONToDynamic(this ISourceText json, bool caseSensitiveMaps = true)
Parameters
Type | Name | Description |
---|---|---|
ISourceText | json | |
System.Boolean | caseSensitiveMaps |
Returns
Type | Description |
---|---|
System.Object |
JSONToDynamic(Stream, Encoding, Boolean)
Deserializes JSON content into dynamic JSON object
Declaration
public static dynamic JSONToDynamic(this Stream json, Encoding encoding = null, bool caseSensitiveMaps = true)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | json | |
System.Text.Encoding | encoding | |
System.Boolean | caseSensitiveMaps |
Returns
Type | Description |
---|---|
System.Object |
JSONToDynamic(String, Boolean)
Deserializes JSON content into dynamic JSON object
Declaration
public static dynamic JSONToDynamic(this string json, bool caseSensitiveMaps = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | json | |
System.Boolean | caseSensitiveMaps |
Returns
Type | Description |
---|---|
System.Object |
ToJSON(Object, JSONWritingOptions)
Serializes object into JSON string
Declaration
public static string ToJSON(this object root, JSONWritingOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | root | |
JSONWritingOptions | options |
Returns
Type | Description |
---|---|
System.String |
ToJSON(Object, Stream, JSONWritingOptions, Encoding)
Serializes object into JSON format using provided stream and optional encoding
Declaration
public static void ToJSON(this object root, Stream stream, JSONWritingOptions options = null, Encoding encoding = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | root | |
System.IO.Stream | stream | |
JSONWritingOptions | options | |
System.Text.Encoding | encoding |
ToJSON(Object, TextWriter, JSONWritingOptions)
Serializes object into JSON format using provided TextWriter
Declaration
public static void ToJSON(this object root, TextWriter wri, JSONWritingOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | root | |
System.IO.TextWriter | wri | |
JSONWritingOptions | options |