C# Language Deserialization


Example

You 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.