It is a lightweight format for storing and transporting data as text
It is often used when data is sent from a server to a web page
It is self-describing, easy to understand and it is often used as an alternative to XML.
Name / Value Pairs
JSON names require double quotes.
This object has 2 keys "firstName" and "lastName".
"staff" is the key.
The "[" and "]" square brackets are an array statement. It means there is the array between them.
All statements in square brackets are values of "staff" key.
There are lots of different .NET serializers:
Newtonsoft.Json / JSON.Net
The purpose of this attribue is to advertise (for example to BinaryFormatter) that this class can be serialised.
Most serializers don't require this attribute.
public class StaffClass
Converting JSON Text to an Object
You need to create class for JSON.
If you want to create easily, you can use the web site jsonutils.com.
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext