title: Querying JSON from C#
body: <p>I'm trying to retreive a json item from a json string,this is my json for example:</p>
  
  <pre><code>{   
  "users":{  
    "john":{  
       "password":"0506777031",
       "level":1
    },
    "doe":{  
       "password":"john",
       "level":1
    },
    "dasda":{  
       "password":"das",
       "level":"1"
    },
    "zuri":{  
       "password":"zuri123",
       "level":2
    }
   }
  }
  </code></pre>
  
  <p>I use the json.net library,this is what i've tried so far:</p>
  
  <pre><code> JObject json = JObject.Parse(jsonstring); //this is thr string       
   JObject match = json["users"].Values&lt;JObject&gt;().Where(m =&gt; m["username"].Value&lt;string&gt;() == "itapi" &amp;&amp; (m["password"].Value&lt;string&gt;() == "0506777031")).FirstOrDefault();
  </code></pre>
  
  <p>I'm getting an error on the second line.
     This is the error:</p>
  
  <blockquote>
    <p>Cannot cast Newtonsoft.Json.Linq.JProperty to Newtonsoft.Json.Linq.JToken.</p>
  </blockquote>
  
  <p>I'm not sure what i'm doing wrong,i will appreciate any help! thanks!</p>