Formattatori e Codice
JSON in classe C#
Generate POCO classes from a JSON sample.
Nota dell'editore
Understanding · Two libraries, one mental model.
Questo capitolo approfondito è attualmente disponibile solo in inglese. Lo strumento di conversione qui sopra funziona nella tua lingua; il lungo articolo esplicativo non è stato ancora tradotto.
Domande frequenti
Quick answers.
›How does the tool handle nested objects?
The generator recursively scans your JSON structure to create separate, linked classes for each nested object level. It ensures that complex hierarchies are mapped to a structured class model.
›What attributes are added to the classes?
The tool can include `[JsonPropertyName]` or `[JsonProperty]` attributes to ensure proper deserialization when JSON keys use different naming conventions than C# properties. This supports both System.Text.Json and Newtonsoft.Json libraries.
›How are data types determined?
It infers types based on the JSON values: integers become `int` or `long`, decimals become `double` or `decimal`, and ISO dates are mapped to `DateTime`. If a value is null, the tool defaults to `object` or a nullable type.
›Is my data sent to any external server?
No. The conversion logic is executed entirely within your web browser. Neither your JSON structure nor the resulting C# code is transmitted or stored on any server.
Le persone cercano anche
Strumenti correlati
More in this room.
- JSON in interfaccia TypeScriptDeduzione dei tipi da un campione JSON ed emissione di interfacce TS.
- JSON in Java POJOEmette un POJO Java da un campione JSON.
- JSON in Python DataclassDataclass con suggerimenti di tipo (con Pydantic opzionale) da JSON.
- JSON in Go StructStrutture Go idiomatiche con tag `json:`.
- JSON in Kotlin Data ClassClassi di dati concise per qualsiasi campione JSON.
- JSON in JSON SchemaDeduzione di un documento JSON Schema da un campione.