0
私はこのようなJSON何か持っている:JSON.NET - 取得ネストされた値
{
"key": "Target",
"value": {
"__type": "Entity:http://schemas.microsoft.com/xrm/2011/Contracts",
"Attributes": [
{
"key": "prioritycode",
"value": {
"__type": "OptionSetValue:http://schemas.microsoft.com/xrm/2011/Contracts",
"Value": 1
}
},
{
"key": "completeinternalreview",
"value": false
},
{
"key": "stepname",
"value": "10-Lead"
},
{
"key": "createdby",
"value": {
"__type": "EntityReference:http://schemas.microsoft.com/xrm/2011/Contracts",
"Id": "ca2ead0c-8786-e511-80f9-3863bb347b18",
"KeyAttributes": [],
"LogicalName": "systemuser",
"Name": null,
"RowVersion": null
}
}
]
}
}
をどのようにキーの値を検索して、キー/値のためTOKE?
public class MyValue
{
[JsonProperty("Attributes")]
public List<KeyValuePair<string, object>> Attributes { get; set; }
}
あなたは、単に文字列をデシリアライズすることができます
例:私はあなたがあなたのJSONからオブジェクトを属性を表すために、このようなC#クラスを持っていると仮定すると、キーと値のペア「completeinternalreview」
JSON文字列を逆シリアル化した後は、単純なLINQクエリを実行できる 'value.Attributes'オブジェクトがあります。 – danielspaniol