title: How to filter JSON array in C#
body: <p>I have spent a lot of time to find a solution for my problem.</p>
  
  <p>In this example, I have 2 records in SetNavRecords array. 
  The first one is <strong>"Artikelnummer" : "21700"</strong> and the second one is <strong>"Artikelnummer" : "21701"</strong> </p>
  
  <p>Each record have an array "OfflineVerkaufspreis". </p>
  
  <p>Important is for me the field "Location_Code" in "OfflineVerkaufspreis"
  I only need the hole informations for one filtered Location Code.</p>
  
  <p>How can I select the data for one Location Code, for example "MH"?</p>
  
  <p>I am using C# and the Newtonsoft Class for JSON parsing. </p>
  
  <p>I have tried some versions with LINQ but without success.</p>
  
  <pre><code>{ "SetNavRecords" : [ { "Artikelbeschreibung" : "Trikot \"Home\" 2012/2013",
      "Artikelbeschreibung2" : "weiß",
      "Artikelnummer" : "21700",
      "Artikelrabattgruppe" : "MERCH",
      "Gutschein" : false,
      "MwStProduktgruppe" : "VOLLNEU",
      "OfflineVerkaufspreis" : [ { "Allow_Line_Discount" : true,
            "Date" : "2014-05-16T00:00:00",
            "Item_No" : "21700",
            "Location_Code" : "BP",
            "Unit_Price" : 5.0
          },
          { "Allow_Line_Discount" : true,
            "Date" : "2014-05-16T00:00:00",
            "Item_No" : "21700",
            "Location_Code" : "MH",
            "Unit_Price" : 5.0
          },
          { "Allow_Line_Discount" : true,              
            "Date" : "2014-05-16T00:00:00",
            "Item_No" : "21700",
            "Location_Code" : "RY",
            "Unit_Price" : 5.0
          }
        ]
    },
    { "Artikelbeschreibung" : "Autogrammtrikot 2012/2013",
      "Artikelbeschreibung2" : "weiß",
      "Artikelnummer" : "21701",
      "Artikelrabattgruppe" : "MERCH",
      "Gutschein" : false,
      "MwStProduktgruppe" : "VOLLNEU",
      "OfflineVerkaufspreis" : [ { "Allow_Line_Discount" : false,
            "Date" : "2014-05-16T00:00:00",
            "Item_No" : "21701",
            "Location_Code" : "BP",
            "Unit_Price" : 69.99
          },
          { "Allow_Line_Discount" : false,
            "Date" : "2014-05-16T00:00:00",
            "Item_No" : "21701",
            "Location_Code" : "MH",
            "Unit_Price" : 69.99
          },
          { "Allow_Line_Discount" : false,
            "Date" : "2014-05-16T00:00:00",
            "Item_No" : "21701",
            "Location_Code" : "RY",
            "Unit_Price" : 69.99
          }
        ]
    }
  
  ] }
  </code></pre>
  
  <p>Here is my problem:</p>
  
  <pre><code>var tmpResult = JObject.Parse(File.ReadAllText(FileName));
  var resultObject = tmpResult["SetNavRecords"]
        .Values("OfflineVerkaufspreis")
        .Values&lt;JObject&gt;()                                   
        .Where(n =&gt; n["Location_Code"].Value&lt;string&gt;() == "MH"); 
  </code></pre>
  
  <p>The filter works fine but the data is incomplete in tmpResult. I only get the data in "OfflineVerkaufspreis". I need the root data too.</p>
  
  <p>Has anybody an idea?</p>
  
  <p>Thanks!</p>