If retrieve a JSON string for which the full schema is not known :
{
... other stuff
"data": [
{
"open": 110.05,
"high": 112.0,
"low": 110.0,
"close": 111.78,
"volume": 21745034.0,
"symbol": "GOOG",
"exchange": "XNAS",
"date": "2022-09-09T00:00:00+0000",
... more fields
},
... more data
Then deserialize into dynamic :
var result = JsonConvert.DeserializeObject<dynamic>(response);
How to query for specific symbols ?
This doesn't work :
var match = result["data"].Where(e => e.Value["symbol"].ToString() == "GOOG").FirstOrDefault();
Gives error :
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.