asp.net core3.x new serial number interfaces System.Text.Json
When serialized, if you want to use camel case for all attribute names JSON
The JsonSerializerOptions.PropertyNamingPolicy set JsonNamingPolicy.CamelCase即可
Example:
1 var serializeOptions = new JsonSerializerOptions 2 { 3 PropertyNamingPolicy = JsonNamingPolicy.CamelCase, 4 WriteIndented = true 5 }; 6 jsonString = JsonSerializer.Serialize(weatherForecast, serializeOptions);