c# json convert to string code example
Example 1: c# object to json string
Newtonsoft.Json.JsonConvert.SerializeObject(new {foo = "bar"})
Example 2: c# json convert
jsonString = File.ReadAllText(fileName);
weatherForecast = JsonSerializer.Deserialize<WeatherForecast>(jsonString);