Hi,
In rails you can do the following to convert an object to Json but only with a subset of the fields included in the object.
@user.to_json :only => [ :name, :phone ]
Although i am using currently the ASP.NET MVC Json() function it doesn't let me define which fields i want to include in the conversion. So my question is whether or not there is a function in JSON.NET or otherwise that will accept specific fields before doing the conversion to json.
Edit: Your answer should also cover the array scenario ie.
@users.to_json :only => [ :name, :phone ]