Class JsonSerializer
- Namespace
- nanoFramework.Json
- Assembly
- nanoFramework.Json.dll
Initializes a new instance of the JsonSerializer class.
public class JsonSerializer
- Inheritance
-
JsonSerializer
- Inherited Members
- Extension Methods
Methods
SerializeObject(object, bool)
Convert an object to a JSON string.
public static string SerializeObject(object o, bool topObject = true)
Parameters
o
objectThe value to convert. Supported types are: bool, string, byte, ushort, short, uint, int, float, double, Array, IDictionary, IEnumerable, Guid, DateTime, TimeSpan, DictionaryEntry, object and null.
topObject
boolIs the object top in hierarchy. Default true.
Returns
- string
The JSON object as a string or null when the value type is not supported.
Remarks
For objects, only internal properties with getters are converted.