I have Jobject for example:
string json = @"
{
""memberdetails"": [
{
""id"": 0,
""label"": ""General Details"",
""visible"": true,
""properties"": [
{
""label"": ""Address"",
""description"": ""Residential or Postal Address"",
""view"": ""textarea"",
""config"": {},
""hideLabel"": false,
""validation"": {
""mandatory"": false,
""pattern"": null
},
""id"": 0,
""value"": ""test 1"",
""alias"": ""address"",
""editor"": ""Umbraco.TextboxMultiple"",
""visible"": ""true""
},
{
""label"": ""State"",
""description"": ""State of residence"",
""view"": ""textbox"",
""config"": {},
""hideLabel"": false,
""validation"": {
""mandatory"": false,
""pattern"": null
},
""id"": 0,
""value"": ""test 2"",
""alias"": ""state"",
""editor"": ""Umbraco.Textbox"",
""visible"": ""true""
}
]
},
{
""id"": 1,
""label"": ""Other Details"",
""visible"": true,
""properties"": [
{
""label"": ""Address"",
""description"": ""Residential or Postal Address"",
""view"": ""textarea"",
""config"": {},
""hideLabel"": false,
""validation"": {
""mandatory"": false,
""pattern"": null
},
""id"": 0,
""value"": ""test_otherdetails1 "",
""alias"": ""address"",
""editor"": ""Umbraco.TextboxMultiple"",
""visible"": ""true""
},
{
""label"": ""State"",
""description"": ""State of residence"",
""view"": ""textbox"",
""config"": {},
""hideLabel"": false,
""validation"": {
""mandatory"": false,
""pattern"": null
},
""id"": 0,
""value"": ""test_otherdetails2"",
""alias"": ""state"",
""editor"": ""Umbraco.Textbox"",
""visible"": ""true""
}
]
},
{
""id"": 2,
""label"": "" Details"",
""visible"": true,
""properties"": [
{
""label"": ""Address"",
""description"": ""Residential or Postal Address"",
""view"": ""textarea"",
""config"": {},
""hideLabel"": false,
""validation"": {
""mandatory"": false,
""pattern"": null
},
""id"": 0,
""value"": "" Details1"",
""alias"": ""address"",
""editor"": ""Umbraco.TextboxMultiple"",
""visible"": ""true""
},
{
""label"": ""State"",
""description"": ""State of residence"",
""view"": ""textbox"",
""config"": {},
""hideLabel"": false,
""validation"": {
""mandatory"": false,
""pattern"": null
},
""id"": 0,
""value"": ""Details1"",
""alias"": ""state"",
""editor"": ""Umbraco.Textbox"",
""visible"": ""true""
}
]
}
]
}";
and i want to get the value of "alias" and "value" as below json format
[
{"address": "test"},
{"state": "test"}
]
so, is there any built in method in json.net where i can get the specific property value?
or do I need to implement some recursive method in c# which will search JToken by name in all JTokens and JArrays in JObject? any suggestion?
Thanks,