Project Description
Json generator and parser written in C#. Besides basic json support, this library enables you to fluently map your custom types to the json data format.

New version 0.7.0:

* Major performance improvements (see example application).
* Multi-threaded encoding (in .NET 4.0 using Task Parallel Library). Also see example application. Can give a descent performance increase when encoding large sets of complex objects.
* A lot of fixes, mainly due to a complete rebuild.

Any suggestions or questions? Head to

* Fluently map your classes to the json data format.
* Ensures strong type mapping.
* Does not require class modifications.
* Does not extend the json data format.
* A single encoder or decoder can be used among multiple threads (thread-safe).
* All functionality is provides from a single (static member) class.

For the latest svn checkouts and source head to:

Fluent mapping:

JsonEncoder<Book> encoder = Json.EncoderFor<Book>(config => config
    .MapType<Book>(map => map


        // DateTime can't be encoded to native json. Conversion is required.
        .Field<DateTime>(field => field.pubDate, pubDate => pubDate
            .EncodeAs<string>(value => value.ToShortDateString())

        // BookType can't be encoded either, let's convert it too.
        .Field<BookType>(field => field.type, type => type
            .EncodeAs<int>(value => (int)value)
            // Lets assume we would want to encode this field to a
            // different json field.

    .MapType<Author>(map => map


Book book = new Book();
book.title = "Around the world in 80 days";
book.tags = new List<string> { "traveling", "adventure" };
book.pageCount = 342;
book.pubDate = DateTime.Now; = new Author(); = "Jules"; = "Verne";

string json = encoder.Encode(book);

Last edited May 10, 2011 at 9:17 PM by adaptivdesign, version 16