2
votes

I want to limit the string length of property value when serializing to JSON using NewtonSoft JSON.NET. How can I do this? Is there a Serializer setting?

1

1 Answers

1
votes
  1. Inherit from DefaultContractResolver
  2. Override CreateProperties
  3. Modify property names after calling base implementation
  4. Use your contract resolver when deserializing by setting JsonSerializerSettings.ContractResolver