There are three ways that come to mind.
-
Assuming the json is consistent and the structure of the response will not change frequently, I would use a tool like json2csharp or jsonutils to create c# classes.
then call:
{GeneratedClass} obj = JsonConvert.DeserializeObject<{GeneratedClass}>(result);
This will give you a strongly typed object that you can use.
-
You can skip the class generation and use a dynamic object:
dynamic obj = JsonConvert.DeserializeObject<dynamic>(result)
and access properties such as:
obj.dialog.prompt;
-
You can use a JObject and access its properties using strings
JObject obj = JsonConvert.DeserializeObject(result); obj["dialog"]["prompt"]