Table of Contents

Class JsonConvert

Namespace
nanoFramework.Json
Assembly
nanoFramework.Json.dll

Provides methods for converting between .NET types and JSON types.

public static class JsonConvert
Inheritance
JsonConvert
Inherited Members

Methods

DeserializeObject(Stream, Type)

Deserializes a Json string into an object.

public static object DeserializeObject(Stream stream, Type type)

Parameters

stream Stream
type Type

The object type to convert to

Returns

object

DeserializeObject(StreamReader, Type)

Deserializes a Json string into an object.

public static object DeserializeObject(StreamReader dr, Type type)

Parameters

dr StreamReader
type Type

The object type to convert to

Returns

object

DeserializeObject(string, Type)

Deserializes a Json string into an object.

public static object DeserializeObject(string sourceString, Type type)

Parameters

sourceString string
type Type

The object type to convert to

Returns

object

SerializeObject(object)

Convert an object to a JSON string.

public static string SerializeObject(object oSource)

Parameters

oSource object

The value to convert. Supported types are: Boolean, String, Byte, (U)Int16, (U)Int32, Float, Double, Decimal, Array, IDictionary, IEnumerable, Guid, Datetime, DictionaryEntry, Object and null.

Returns

string

The JSON object as a string or null when the value type is not supported.

Remarks

For objects, only public properties with getters are converted.