title: LINQ where query on a JToken
body: <p>I'm new to LINQ query and I want to get 1 item (the one with <code>id = 0</code>) out of a <code>JToken</code> but I can't find out how this should be working.</p>
  
  <p>I tried a lot a different way but this the code I tried first :</p>
  
  <pre><code>var statId0 = from stat in objectRankedStats where (int)stat["id"] == 0 select stat;
  </code></pre>
  
  <p>I've got this error : </p>
  
  <blockquote>
    <p>Could not find an implementation of the query pattern for source type 'Newtonsoft.Json.Linq.JToken'.  'Where' not found.  Are you missing a reference or a using directive for 'System.Linq'?  </p>
  </blockquote>
  
  <p>This is what looks like <code>objectRankedStats</code> :</p>
  
  <pre><code>{[  {
      "id": 40,
      "stats": 
      {
          "totalSessionsPlayed": 10,
          "totalSessionsLost": 8,
          "totalSessionsWon": 2,
      }  
  },
  {    
      "id": 6,
      "stats":
      {      
          "totalSessionsPlayed": 3,
          "totalSessionsLost": 2,
          "totalSessionsWon": 1, 
      }  
  }
  </code></pre>
  
  <p>]}  </p>
  
  <p>I don't understand how the "quotes" handle backspaces</p>
  
  <p>I declared objectRankedStats like this and I use it somewhere else in my code and it works.</p>
  
  <pre><code>var objectRankedStats = JObject.Parse(output)["champions"];
  </code></pre>
  
  <p>This is why I think it's null :
  <img src="https://i.stack.imgur.com/BJFez.png" alt="enter image description here"></p>
  
  <p>I made a simplify version of the code I'm using on dotnetFiddle.com : <a href="https://dotnetfiddle.net/yS5cTk" rel="nofollow noreferrer">https://dotnetfiddle.net/yS5cTk</a></p>