Snippets created by Dmitry Lobanov

  • Lightweight syntax for creating JSon objects using Newtonsoft's Json.Net

    There's an easy way to create JSon objects using Newtonsoft's Json.Net. The common problem with Json.Net is that there's usualy a lot of overhead when creating Json with it as there're a lot of 'new', parentheses, nested objects when we don't need them. And it becomes annoying quite fast. DU Json and toJson function allow to create Json tree and convert it to Json.Net JObject hierarchy. On the examples the usage of lightweight syntax doesn't give a lot of win but it will be more clearer when it come to more complicated objects.

    7 people like this

    Posted: 12 years ago by Dmitry Lobanov