I have a JSON file and want to select and update some parts of it. after using LINQ query to extract some values, get Platform not supported error. but same code works correctly in .Net framework 4.6.
Json file:
{
"server": {
"name": "Server Service",
},
"hosts": [
{
"id": 0
},
{
"id": 1000,
},
{
"id": 1001,
},
{
"id": 1003,
}
]
}
C# code:
var xd = json["hosts"].Select(x => ((JObject)x)["Id"]).ToList();
Id you are trying to take should be in camelCase.
Json file:
C# code: