开发者

Json.Net: JsonSerializer-Attribute for custom naming [duplicate]

This question already has answers here: How can I change property names when serializing with Json.net? 开发者_运维知识库 (4 answers) Closed 7 years ago.

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?


I think I found the solution:

[JsonProperty(PropertyName = "Myname")]

will rename it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜