File tree 1 file changed +5
-4
lines changed
samples/QuickstartWeatherServer/Tools
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,10 @@ public static async Task<string> GetForecast(
45
45
jsonElement = await client . GetFromJsonAsync < JsonElement > ( forecastUrl ) ;
46
46
var periods = jsonElement . GetProperty ( "properties" ) . GetProperty ( "periods" ) . EnumerateArray ( ) ;
47
47
48
- return periods . Select ( period =>
49
- {
50
- return $ """
48
+ return string . Join ( "\n ---\n " ,
49
+ periods . Select ( period =>
50
+ {
51
+ return $ """
51
52
Name: { period . GetProperty ( "name" ) . GetString ( ) }
52
53
Start Time: { period . GetProperty ( "startTime" ) . GetString ( ) }
53
54
End Time: { period . GetProperty ( "endTime" ) . GetString ( ) }
@@ -57,6 +58,6 @@ public static async Task<string> GetForecast(
57
58
Short Forecast: { period . GetProperty ( "shortForecast" ) . GetString ( ) }
58
59
Detailed Forecast: { period . GetProperty ( "detailedForecast" ) . GetString ( ) }
59
60
""" ;
60
- } ) . Aggregate ( ( current , next ) => current + " \n -- \n " + next ) ;
61
+ } ) ) ;
61
62
}
62
63
}
You can’t perform that action at this time.
0 commit comments