Deserialization
suggest changeYou can receive a json from anywhere, a file or even a server so it is not included in the following code.
static void Main(string[] args)
{
string jsonExample; // Has the previous json
Author author = JsonConvert.DeserializeObject<Author>(jsonExample);
}
The method “.DeserializeObject” deserializes ‘jsonExample’ into an “Author” object. This is why it is important to set the json variables in the classes definition, so the method access it in order to fill it.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents