using System.Collections.Generic;
public List<User> users { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public static void Main()
var users = new List<User>();
users.Add(new User { Name = "Alice",Age = 20 });
users.Add(new User { Name = "Bob",Age = 30 });
var options = new JsonSerializerOptions { WriteIndented = true };
string jsonString = JsonSerializer.Serialize(body, options);
Console.WriteLine(jsonString);