API呼び出しから受け取ったJson応答があります。以下に示すように、いくつかのネストされたレベルがあります(これはスニペットです)。
"Items": [
  {
    "Result": {
      "Id": "191e24b8-887d-e111-96ec-000c29128cee",
      "Name": "Name",
      "StartDate": "2012-04-03T00:00:00+01:00",
      "EndDate": null,
      "Status": {
        "Name": "Active",
        "Value": 5
      },
      "Client": {
        "Id": "35ea10da-b8d5-4ef8-bf23-c829ae90fe60",
        "Name": "client Name",
        "AdditionalItems": {}
      },
      "ServiceAgreement": {
        "Id": "65216699-a409-44b0-8294-0e995eb05d9d",
        "Name": "Name",
        "AdditionalItems": {
          "ScheduleBased": true,
          "PayFrequency": {
            "Id": "981acb72-8291-de11-98fa-005056c00008",
            "Name": "Weekly",
            "AdditionalItems": {}
          },
          "PayCycle": [
            {
              "Name": "Schedule Based",
              "ScheduleBased": true,
              "SelfBilling": false,
              "Id": "a8a2ecc4-ff79-46da-a135-743b57808ec3",
              "CreatedOn": "2011-09-16T23:32:19+01:00",
              "CreatedBy": "System Administrator",
              "ModifiedOn": "2011-09-16T23:32:19+01:00",
              "ModifiedBy": "System Administrator",
              "Archived": false
            }
          ]
        }
      },
}
]
...
私がやりたいのは、Linqを使用してPayCycleノードからデータを取得することです。たとえば、コントローラーで次のLinqを使用して、Result.ServiceAgreement.AdditionalItems.SchedultedBasedを使用してtrueの値を持つアイテムを取得できます。
var result = from p in data["Data"]["Items"].Children()
             where (bool)p["Result"]["ServiceAgreement"]["AdditionalItems"]["ScheduleBased"] == true
             select new
             {
                 Name = (string)p["Result"]["Client"]["Name"],
                 Id = (string)p["Result"]["Client"]["Id"]
             };
Result.ServiceAgreement.AdditionalItems.Paycycle.ScheduleBased次に、プロパティを取得する必要がありSelfBillingます。PayCycleも配列である場合、これを行うにはどうすればよいですか。上記のLinqのData.Itemsで行ったように子を取得して、これらの両方のアイテムにwhere句フィルターを設定できるようにするにはどうすればよいですか。