Retrieve the object list of property names?

Jul 10, 2008 at 8:25 AM
Hey!

I wan't to get the list of property names where [JsonProperty] is declared from an object.. Ex:

[code]
[JsonObject(MemberSerialization.OptIn)]
public class Product {
    [JsonProperty]
    public int Id { get; set; }

    [JsonProperty]
    public String Name { get; set; }

    [JsonProperty]
    public Float Price { get; set; }

    public int NotMe { get; set; }
}
[/code]

Then I would wan't to get a list like this;
[{name: "Id"},{name: "Name"},{name:"Price", type:"float"}]

Regards,
</Jonas>
Coordinator
Aug 2, 2008 at 8:41 AM
You will need to write some custom code to query that information. Writing the JSON object can still be done using Json.NET however.