Which procedure and data-structure should I use that will give me access all the key-value pairs in a nested JSON string in C#?
Pictured below is a portion of the JSON string I am working with. As you can see it is nested. I am seeking to retrieve the "date" and "message" from each block with their respective keys using C-Sharp C#.
I have tried putting my JSON string into a Dictionary.
private static async Task<String> ProcessRepo()
{
var stringTask = APIclient.GetStringAsync("https://a.RESTapi.fakecom");
var x = await stringTask;
Dictionary<string, object> data = JsonConvert.DeserializeObject<Dictionary<string, object>>(x);
return data;
}
This gives me 2 key-values pairs. One is "pagelen" with a value of 30, and the other is "values" with a value of everything that followed in one long string. Not very useful.
This is my first time using C#. Please point me in the right direction. I have spent many hours searching for something that will work.