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?

0

1 Answer 1

55

I think I found the solution:

[JsonProperty(PropertyName = "Myname")]

will rename it.

Sign up to request clarification or add additional context in comments.

1 Comment

Why did this get accepted? This does not give the object itself a name, that is what is being asked. This renames a property marked for serialization.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.