Follow me on Twitter at
FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:
Cool LINQ over JSON..........In MonoDroid no less - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on Web, HTML5, Mobile, Xamarin.iOS, Xamarin.Android, and Windows Azure.


Visual Studio Magazine Column Personal Blog


Book Authors




Georgia Tech Bloggers



Cool LINQ over JSON..........In MonoDroid no less

I was working on some json/rest web services written in windows communication foundation (wcf).  I wanted to use the System.Json namespace to do some of this.  I made an http web request asynchronously.  In my call back method, I have following code doing a linq query over this json result.

System.Json.JsonArray jsonArray = (System.Json.JsonArray)System.Json.JsonArray.Load(strm);
var twt = (from jsonTweet in jsonArray
            select new Tweet

                ProfileImage = jsonTweet["ProfileImage"].ToString(),
                Status = jsonTweet["Status"].ToString(),
                StatusDate = jsonTweet["StatusDate"],
                StatusId = Convert.ToInt64(jsonTweet["StatusId"].ToString()),
                UserName = jsonTweet["UserName"].ToString()

Now I have a list of type Tweet. 

fyi, I didn't need to do a .ToList<> for this, but I was doing something else.

I hope this helps you out in your coding
Posted: Jan 19 2011, 06:00 AM by Wallym | with 1 comment(s)
Filed under: , , , ,


No Comments