How to use it
- Paste a sample of your JSON or XML.
- Keep C# selected and enter a class name if you like.
- Copy the classes and check the types.
How types are chosen
Whole numbers become int or long, and numbers with a decimal point become double. Use decimal instead for money. A field missing from some list items, or set to null, becomes nullable. Names that differ from C# style get [JsonPropertyName].
Limits
Types come from your sample only. A larger sample gives a better result. Attributes are for System.Text.Json, not Newtonsoft.Json.
Questions
What happens with very large numbers?
Numbers beyond the long range become decimal, with a warning. Check that it is large enough for your data.
Can I use XML?
Yes, but XML has no data types, so values become strings.