Customizing property names & values when reading .NET objects as JSON

preview_player
Показать описание
By default, property names and dictionary keys are unchanged in the JSON output, including case. Enum values are represented as numbers. And properties are serialized in the order they're defined. However, you can customize these behaviors by customizing property names and dictionary keys in the JSON output, including case and the order they're defined. James and Matt break it all down.

Chapters:
00:00 - Introduction JSON properties
01:30 - Customizing property names
04:00 - Property naming policies and casing
09:45 - Custom naming policies
11:45 - Sorting JSON properties
14:40 - Wrap-up

Resources:

Connect with .NET:

#dotnet
Рекомендации по теме
Комментарии
Автор

Well done, Matt, for pointing out it is a wind strength or force expressed in Beaufort and great that we can be stubborn and call it wind speed in our application although we might wonder at some point why this "speed" never goes over 12...

robinheyer
Автор

But when deserialize, how to bind "wind" from json file or json string, and output as "windSpeed"?

adilocara
Автор

Really awesome and helpful. Thanks Matt & James.

shahnawazk
welcome to shbcf.ru