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 Stream into an object.
public static object DeserializeObject(Stream stream, Type type)
Parameters
Returns
- object
The deserialized object.
DeserializeObject(Stream, Type, JsonSerializerOptions)
Deserializes a JSON Stream into an object.
public static object DeserializeObject(Stream stream, Type type, JsonSerializerOptions options)
Parameters
streamStreamThe JSON stream to deserialize.
typeTypeThe type to deserialize to.
optionsJsonSerializerOptionsThe JsonSerializerOptions to be used during deserialization.
Returns
- object
The deserialized object.
DeserializeObject(StreamReader, Type)
Deserializes a JSON StreamReader into an object.
public static object DeserializeObject(StreamReader streamReader, Type type)
Parameters
streamReaderStreamReaderThe JSON stream reader to deserialize.
typeTypeThe type to deserialize to.
Returns
- object
The deserialized object.
DeserializeObject(StreamReader, Type, JsonSerializerOptions)
Deserializes a JSON StreamReader into an object.
public static object DeserializeObject(StreamReader streamReader, Type type, JsonSerializerOptions options)
Parameters
streamReaderStreamReaderThe JSON stream reader to deserialize.
typeTypeThe type to deserialize to.
optionsJsonSerializerOptionsThe JsonSerializerOptions to be used during deserialization.
Returns
- object
The deserialized object.
DeserializeObject(string, Type)
Deserializes a JSON string into an object.
public static object DeserializeObject(string value, Type type)
Parameters
Returns
- object
The deserialized object.
DeserializeObject(string, Type, JsonSerializerOptions)
Deserializes a JSON string into an object.
public static object DeserializeObject(string value, Type type, JsonSerializerOptions options)
Parameters
valuestringThe JSON string to deserialize.
typeTypeThe type to deserialize to.
optionsJsonSerializerOptionsThe JsonSerializerOptions to be used during deserialization.
Returns
- object
The deserialized object.
SerializeObject(object)
Convert an object to a JSON string.
public static string SerializeObject(object oSource)
Parameters
oSourceobjectThe 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.