Skip to content

Commit 7f9c6b5

Browse files
Copilotgewarren
andauthored
Fix async method naming convention in code example (#47588)
* Initial plan * Fix async method naming: rename GetDotNetCount to GetDotNetCountAsync Co-authored-by: gewarren <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: gewarren <[email protected]>
1 parent 98d8f43 commit 7f9c6b5

File tree

1 file changed

+3
-3
lines changed
  • docs/csharp/asynchronous-programming/snippets/async-scenarios

1 file changed

+3
-3
lines changed

docs/csharp/asynchronous-programming/snippets/async-scenarios/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ private static async Task<User[]> GetUsersAsyncByLINQ(IEnumerable<int> userIds)
147147

148148
// <ExtractDataFromNetwork>
149149
[HttpGet, Route("DotNetCount")]
150-
static public async Task<int> GetDotNetCount(string URL)
150+
static public async Task<int> GetDotNetCountAsync(string URL)
151151
{
152-
// Suspends GetDotNetCount() to allow the caller (the web server)
152+
// Suspends GetDotNetCountAsync() to allow the caller (the web server)
153153
// to accept another request, rather than blocking on this one.
154154
var html = await s_httpClient.GetStringAsync(URL);
155155
return Regex.Matches(html, @"\.NET").Count;
@@ -164,7 +164,7 @@ static async Task Main()
164164
int total = 0;
165165
foreach (string url in s_urlList)
166166
{
167-
var result = await GetDotNetCount(url);
167+
var result = await GetDotNetCountAsync(url);
168168
Console.WriteLine($"{url}: {result}");
169169
total += result;
170170
}

0 commit comments

Comments
 (0)