This project has moved and is read-only. For the latest updates, please go here.

Fluent JSON creation (and Knockout)

Oct 24, 2011 at 9:02 PM
Edited Nov 1, 2011 at 9:55 PM

I created a Fluent JSON library for building Knockout view models (or any other JSON object) built on top of JSON.NET. I thought I would share:

The FluentJSON component allows you to create JSON in a Razor view like this (note the Knockout extension methods):

    .AddProperty("name", "value")
    .AddProperty("childObject", c => {
        .AddProperty("childProperty", "value2")
    .AddObservable("knockoutProperty", 123)

This would produce JSON similar to this:




The Knockout methods are added via extension methods and other things can easily extend as well.  Please feel free to comment / criticize over at GitHub.