Skip to content

格式化与代码

JSON 转 C# Record

Modern C# records with JsonPropertyName attributes.

Runs in your browser

编辑注

Understanding · A class, but the values mean it.

本深度章节目前仅有英文版本。上方的转换工具支持您的语言;长篇说明文章尚未翻译。

常见问题

Quick answers.

How are JSON types mapped to C#?

Strings map to `string`, numbers to `double` or `int`, booleans to `bool`, and arrays to `List<T>`. Null values or missing data default to nullable types where appropriate.

Does this tool support nested objects?

Yes. The converter recursively parses nested JSON structures and generates a separate record definition for each unique object found.

Why are attributes added to each property?

The `JsonPropertyName` attribute ensures that the C# property follows .NET PascalCase naming conventions while correctly mapping to the original JSON key during serialisation.

Is my data sent to a server for processing?

No. The conversion is performed locally using JavaScript in your browser. No sensitive data or API payloads are transmitted over the network.

大家也在搜索

相关工具

More in this room.

查看所有 格式化与代码