Alex Rivera | Logout

Json.Net: JsonSerializer-Attribute for custom naming

Asked 2011-07-28T14:27:09.990
32

I use the JsonSerializer from Newtonsoft.

But i want to name the json-objects by myself.

I tried the JsonObject attribute

[JsonObject(Description = "MyName", Title = "orThisname")]

JsonArray also didnt work... Is it possible to name the json-objetcs/arrays by myself?

Edit
Report

1 Answer

55

I think I found the solution:

[JsonProperty(PropertyName = "Myname")]

will rename it.

answered 2011-07-28T15:00:25.457

Your Answer