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
stream
StreamThe JSON stream to deserialize.
type
TypeThe type to deserialize to.
options
JsonSerializerOptionsThe 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
streamReader
StreamReaderThe JSON stream reader to deserialize.
type
TypeThe 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
streamReader
StreamReaderThe JSON stream reader to deserialize.
type
TypeThe type to deserialize to.
options
JsonSerializerOptionsThe 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
value
stringThe JSON string to deserialize.
type
TypeThe type to deserialize to.
options
JsonSerializerOptionsThe 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
oSource
objectThe 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.