Skip to content

Commit 0a831d0

Browse files
authored
Revert to string.Join
1 parent 547ac4c commit 0a831d0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

samples/QuickstartWeatherServer/Tools/WeatherTools.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ public static async Task<string> GetForecast(
4545
jsonElement = await client.GetFromJsonAsync<JsonElement>(forecastUrl);
4646
var periods = jsonElement.GetProperty("properties").GetProperty("periods").EnumerateArray();
4747

48-
return periods.Select(period =>
49-
{
50-
return $"""
48+
return string.Join("\n---\n",
49+
periods.Select(period =>
50+
{
51+
return $"""
5152
Name: {period.GetProperty("name").GetString()}
5253
Start Time: {period.GetProperty("startTime").GetString()}
5354
End Time: {period.GetProperty("endTime").GetString()}
@@ -57,6 +58,6 @@ public static async Task<string> GetForecast(
5758
Short Forecast: {period.GetProperty("shortForecast").GetString()}
5859
Detailed Forecast: {period.GetProperty("detailedForecast").GetString()}
5960
""";
60-
}).Aggregate((current, next) => current + "\n--\n" + next);
61+
}));
6162
}
6263
}

0 commit comments

Comments
 (0)