Monday, March 3rd, 2008
Json.NET 2.0
James Newton-King has quickly released a new version of Json.NET that has a new easier syntax for querying and and creating JSON.
Creating JSON
JAVASCRIPT:
-
-
JObject o = JObject.FromObject(new
-
{
-
channel = new
-
{
-
title = "James Newton-King",
-
link = "http://james.newtonking.com",
-
description = "James Newton-King's blog.",
-
item =
-
from p in posts
-
orderby p.Title
-
select new
-
{
-
title = p.Title,
-
description = p.Description,
-
link = p.Link,
-
category = p.Categories
-
}
-
}
-
});
-
Querying JSON
JAVASCRIPT:
-
-
var categories =
-
from c in rss["channel"]["item"].Children()["category"].Values<string>()
-
group c by c into g
-
orderby g.Count() descending
-
select new { Category = g.Key, Count = g.Count() };
-





3.9 rating from 35 votes








This looks good. I use Json.NET when I’m not using ASP.NET AJAX and it’s very useful.
@Dion: I think the two code examples are in C# not JavaScript.
These cliche web 2.0 logos aren’t funny anymore, just irritating
Just a quick correction: the first code block appears to be C# code using LINQ to populate a JSON object (using new fangled C# features like anonymous types and variable instantiation)
thank you.
Thanks. Good article.
Interesting Article, thanks Armenian Genocide , great information and research.
Thats great thanks
It’s good. I use Json.NET when I’m not using ASP.NET AJAX. It helps my works a lot.
yuhirocks from quit smoking
Gucci, on the othergucci handbags hand, presents us with popularity for all gucci diaper bagsthe wrong reasons. In fact, he is currently grounded in his home state of Georgia duefake gucci handbags to legal woes, according to The Associated Press. And unless the bandana-bearer’s albumgucci wallets for men represents a total departure from his current persona, ’s drug references, rampant materialism, brushes with the law and cheap wedding dressesspeak-and-spell rhymes make him a poster child for what ails mainstream rap.
It’s Good,Really it is very good.
we web designing company also doing works in .net.
please feel free to contact us at http://www.technowizpvtltd.com