I am using JSON.NET to de-serialize some JSON from a web service. I want to determine if some token is present, and then act on it.
JToken token = JObject.Parse(JsonData);
I use the above to de-serialize the data, I then tried the following
if (((string)token.SelectToken("tokenname")) != null) { Debug.WriteLine("found"); } else { Debug.WriteLine("not found"); }
every time he returns, not found. Any ideas? thanks
source share