AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
Generate C# class definitions from JSON data — with properties, attributes, and nullable types
using System.Text.Json.Serialization;
public class User
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("name")]
public string? Name { get; set; }
}
Classes
0
Properties
0
Nullable
-
Nesting
0
A POCO (Plain Old CLR Object) is a simple C# class with auto-implemented properties. It's the foundation for data transfer objects, entity models, and API response models in .NET applications. With JSON serialization attributes, you can control property naming during serialization.
.cs file.The generated C# classes use modern syntax compatible with .NET 5+ and .NET Core 3.1+. The JsonPropertyName attribute requires System.Text.Json which is included in .NET Core 3.0 and later. For older .NET Framework projects, you can disable the attribute option.
JsonPropertyName is an attribute from System.Text.Json.Serialization that maps C# property names to their JSON key equivalents. Use it when your JSON keys use different casing conventions than your C# properties (e.g., JSON has first_name but C# uses FirstName).
When nullable reference types are enabled, value-type properties (int, DateTime, etc.) become nullable with ? suffixes (e.g., int?). Reference-type properties like string also get the nullable annotation. This requires a nullable-enabled project context.
Yes. Nested objects are generated as separate classes within the same namespace. Each nested class has its own properties, and the parent class references the nested class as a property type.
Yes. Simply disable the JsonPropertyName option and add your own Newtonsoft attributes like [JsonProperty("name")] manually. The core class structure and property definitions remain the same.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026