0

I am trying to return a class object where it will serialize the json without lowercase of the first letter of the property names. I can add the [JsonProperty{"MyField")] and that does work but is there a easier way as I have a lot of properties to do this for on the class. I don't want to set a global setting where it may break some things so just trying to see in my API best way to make sure the serialized json returns as is.

Thanks all

beantownace
  • 117
  • 1
  • 10
  • Add `[JsonObject(NamingStrategyType = typeof(DefaultNamingStrategy))]` to your class. See: [Issue with serializing data using JSON.Net](https://stackoverflow.com/a/40687963/3744182) and [Configure Json.NET serialization settings on a class level](https://stackoverflow.com/q/44805490/3744182). In fact I think this is a duplicate, agree? – dbc Apr 16 '20 at 01:07
  • @dbc awesome that is exactly what I needed thanks. Should I delete this question do you think? – beantownace Apr 16 '20 at 01:14
  • You can if you want to. I marked your question as a duplicate so there's no need to do so. – dbc Apr 16 '20 at 01:16

0 Answers0