File tree Expand file tree Collapse file tree
samples/QuickstartWeatherServer/Tools Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments