I have the following json string:
[
{
"id": 1,
"type": "bird",
"includeorexclude": "include"
},
{
"id": 2,
"type": "animal",
"includeorexclude": "include"
},
{
"id": 3,
"type": "animal",
"includeorexclude": "exclude"
}
]
And here is the code to select type from each json object:
var queries = JArray.Parse(json);
var queryTypes = queries.SelectTokens("$..type")
.Select(x => x.Value<string>())
.ToList();
foreach (var type in queryTypes)
{
// var message = CreateMessage();
// message.UserProperties.Add("Type", type);
}
How do I get both type and includeorexclude from each json object?