✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
var opt = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault };
System.Console.WriteLine(JsonSerializer.Serialize(new { n = 0 }, opt));