Skip to content

Commit 8d6b064

Browse files
agockestephentoub
andauthored
Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
1 parent 380cd6a commit 8d6b064

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

samples/QuickstartWeatherServer/Tools/HttpClientExt.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
using System.Text.Json;
32

43
namespace ModelContextProtocol;
54

65
internal static class HttpClientExt
76
{
8-
public static async Task<JsonDocument> ReadJsonDocument(this HttpClient client, string requestUri)
7+
public static async Task<JsonDocument> ReadJsonDocumentAsync(this HttpClient client, string requestUri)
98
{
109
using var response = await client.GetAsync(requestUri);
1110
response.EnsureSuccessStatusCode();

samples/QuickstartWeatherServer/Tools/WeatherTools.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static async Task<string> GetAlerts(
1414
HttpClient client,
1515
[Description("The US state to get alerts for.")] string state)
1616
{
17-
using var jsonDocument = await client.ReadJsonDocument($"/alerts/active/area/{state}");
17+
using var jsonDocument = await client.ReadJsonDocumentAsync($"/alerts/active/area/{state}");
1818
var jsonElement = jsonDocument.RootElement;
1919
var alerts = jsonElement.GetProperty("features").EnumerateArray();
2020

@@ -42,7 +42,7 @@ public static async Task<string> GetForecast(
4242
[Description("Latitude of the location.")] double latitude,
4343
[Description("Longitude of the location.")] double longitude)
4444
{
45-
using var jsonDocument = await client.ReadJsonDocument($"/points/{latitude},{longitude}");
45+
using var jsonDocument = await client.ReadJsonDocumentAsync($"/points/{latitude},{longitude}");
4646
var jsonElement = jsonDocument.RootElement;
4747
var periods = jsonElement.GetProperty("properties").GetProperty("periods").EnumerateArray();
4848

0 commit comments

Comments
 (0)