C# – Deserialize JSON to dynamic object
If you want to deserialize JSON without having to create a bunch of classes, your best option is to use Newtonsoft.Json. Here’s an example. Let’s say you want to deserialize the following JSON: To deserialize this to a dynamic object with Newtonsoft, use JsonConvert.DeserializeObject<dynamic>: This outputs the following: Deserialize to ExpandoObject in older versions of … Read more