-
Notifications
You must be signed in to change notification settings - Fork 6k
Clarify expected behavior in LINQ async example #47626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: BillWagner <[email protected]>
Copilot finished work on behalf of
BillWagner
July 29, 2025 21:11
@copilot Please fix the three markdown lint issues. |
…around code blocks Co-authored-by: BillWagner <[email protected]>
BillWagner
approved these changes
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM and is ready for final review.
gewarren
approved these changes
Aug 5, 2025
Co-authored-by: gewarren <[email protected]>
Copilot finished work on behalf of
gewarren
August 5, 2025 19:54
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
async-task-programming/subsvc
dotnet-csharp/svc
okr-quality
Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The LINQ async example in the C# asynchronous programming documentation was causing confusion about whether the shown approach was correct or problematic. The example demonstrated the correct implementation using
.ToArray()
for immediate evaluation, but the accompanying warning text suggested there was an issue with the approach, leaving readers uncertain about best practices.Changes Made
Before: The documentation showed a correct LINQ example but included confusing warning text that made it unclear whether this was the recommended approach.
After: The documentation now clearly:
.ToArray()
.ToArray()
ensures immediate task execution and concurrent processing.ToArray()
.ToArray()
or.ToList()
with async LINQExample of the clarification:
This change eliminates the confusion identified in the issue by making it crystal clear that the LINQ approach with
.ToArray()
is the recommended way to create concurrent async tasks.Fixes #27720.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
learn.microsoft.com
/home/REDACTED/work/docs/docs/docs/csharp/asynchronous-programming/snippets/async-scenarios/bin/Debug/net8.0/async-scenarios
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
Internal previews