Activate your free membership today | Log-in

Tuesday, February 12th, 2008

LINQ to JSON

Category: .NET, JSON

James Newton-King has posted a new bit of code called LINQ to JSON which is a .NET LINQ style API over JSON.

For example, here is how you could get out categories and how often they are used:

JAVASCRIPT:
  1.  
  2. var categories =
  3.   from c in rss.PropertyValue<jobject>("channel")
  4.               .PropertyValue<jarray>("item")
  5.               .Children<jobject>()
  6.               .PropertyValues<jarray>("category")
  7.               .Children<string>()
  8.   group c by c into g
  9.   orderby g.Count() descending
  10.   select new { Category = g.Key, Count = g.Count() };
  11.  

There is also a project, JSLINQ which is an implementation of LINQ to Objects implemented in JavaScript. It is built using a set of extension methods built on top of the JavaScript Array object. If you are using an Array, you can use JSLINQ.

Posted by Dion Almaer at 7:00 am
7 Comments

++++-
4 rating from 24 votes

7 Comments »

Comments feed TrackBack URI

Just to be complete: there’s also PHPLinq on http://codeplex.com/PHPLinq .

Comment by maartenba — February 12, 2008

One word, EXCELLENT!

Comment by Liming — February 12, 2008

Jaql (http://www.jaql.org/) looks like another one.

Comment by michele — February 12, 2008

how about dynamic linq, I think that’s more useful than normal linq

Comment by phpcs — February 12, 2008

Very cool…. nice to see LINQ crossing the Microsoft chasm.

Comment by jonbruce — February 12, 2008

Interesting Article, thanks Armenian Genocide , great information and research.

Comment by ArmenianGenocide — June 8, 2008

Why not both? Becausegucci handbags the industry has evolved–for the worse.I grew up listening to gucci walletsa balance of rap music. It was easy to admire replica gucci handbagsthe “street knowledge” of NWA, alongside the bass-shaking of 2gucci trolleys Live Crew and edutainment of KRS-One. Sometimescheap wedding dresses you could find it all in one effort.

Comment by wuwei — December 16, 2009

Leave a comment

You must be logged in to post a comment.