asp.net core 3.1 json serialization code example Example: c# json serialize string jsonString = JsonSerializer.Serialize(weatherForecast);