I have a JSON file from our CRM:
[{"name": "erwin", "type":"ma", "id":"129"}, {"name": "hans", "type":"tf", "id":"12"}]
Now I need to sort this JSON by ID value, in my example the output should be:
[{"name": "hans", "type":"tf", "id":"12"}, {"name": "erwin", "type":"ma", "id":"129"}]
I already found this thread: C# Sort JSON string keys
But I don`t know how to load my JSON file into the method from the solution. Maybe with json.net? Regards,
Francis
EDIT:
string sourcePath = @Settings.Default.folder;
string pathToSourceFile = Path.Combine(sourcePath, "myfile.json");
var list = JsonConvert.DeserializeObject<List<Gesamtplan>>(File.ReadAllText(pathToSourceFile));