Deserialization

suggest change

The JSON can come from a file or a server. This snippet only shows the conversion. JsonConvert is in Newtonsoft.Json.

static void Main(string[] args)
{
    string jsonExample; // Has the previous json
    Author author = JsonConvert.DeserializeObject<Author>(jsonExample);
}

DeserializeObject<Author> builds an Author by matching JSON names to that type's properties.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents