Skip to content
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

Incorrect Output #43760

Closed
mthanson8333 opened this issue Nov 25, 2024 · 0 comments · Fixed by #44410
Closed

Incorrect Output #43760

mthanson8333 opened this issue Nov 25, 2024 · 0 comments · Fixed by #44410
Assignees
Labels
csharp-linq/subsvc dotnet-csharp/svc in-pr This issue will be closed (fixed) by an active pull request. okr-freshness OKR: Freshness of content okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@mthanson8333
Copy link

mthanson8333 commented Nov 25, 2024

Type of issue

Other (describe below)

Description

The second example under "Query variable" produces different results.
`City[] cities = [
new City("Tokyo", 37_833_000),
new City("Delhi", 30_290_000),
new City("Shanghai", 27_110_000),
new City("São Paulo", 22_043_000)
];

//Query syntax
IEnumerable queryMajorCities =
from city in cities
where city.Population > 100000
select city;

// Execute the query to produce the results
foreach (City city in queryMajorCities)
{
Console.WriteLine(city);
}

// Output:
// City { Population = 120000 }
// City { Population = 112000 }
// City { Population = 150340 }

// Method-based syntax
IEnumerable queryMajorCities2 = cities.Where(c => c.Population > 100000);`

Actual output is:
City { Name = Tokyo, Population = 37833000 } City { Name = Delhi, Population = 30290000 } City { Name = Shanghai, Population = 27110000 } City { Name = São Paulo, Population = 22043000 }
Recommend updated the where in queryMajorCities.
[Enter feedback here]

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/linq/get-started/query-expression-basics

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/linq/get-started/query-expression-basics.md

Document Version Independent Id

4fa6e86d-a790-6933-e0ee-a090e3133f0f

Article author

@BillWagner

Metadata

  • ID: d9fdf663-0533-1971-d9e0-245f1cdc69d7
  • Service: dotnet-csharp
  • Sub-service: csharp-linq

Related Issues


Associated WorkItem - 350767

@dotnetrepoman dotnetrepoman bot added the ⌚ Not Triaged Not triaged label Nov 25, 2024
@BillWagner BillWagner self-assigned this Nov 26, 2024
@dotnetrepoman dotnetrepoman bot removed the ⌚ Not Triaged Not triaged label Nov 26, 2024
@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. labels Nov 26, 2024
@BillWagner BillWagner added the 🗺️ reQUEST Triggers an issue to be imported into Quest. label Nov 26, 2024
@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Nov 26, 2024
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Dec 3, 2024
@BillWagner BillWagner added okr-curation OKR: Curate content to remove outdated recommendations okr-freshness OKR: Freshness of content and removed okr-curation OKR: Curate content to remove outdated recommendations labels Dec 4, 2024
@BillWagner BillWagner moved this from 🔖 Ready to Slipped in dotnet/docs December 2024 Sprint Jan 6, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 6, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 6, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 6, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 6, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 8, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 8, 2025
@BillWagner BillWagner moved this from 🔖 Ready to 🏗 In progress in dotnet/docs January 2025 sprint project Jan 16, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 16, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 16, 2025
BillWagner added a commit to BillWagner/docs that referenced this issue Jan 16, 2025
- Fixes dotnet#43760: Update where clause to filter out some values. Update output comment.
- Fixes dotnet#43765:  Update `let` statement so the query result isn't empty.
- Fixes dotnet#43766: Update query parameters so the result set isn't empty.
- Fixes dotnet#43768: Add sample data
- Fixes dotnet#43790: Audit all samples in this article and ensure all have output.
- Fixes dotnet#43809:  Update samples to include the data sources.

While doing this, update the project to .NET 9
@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label Jan 16, 2025
@BillWagner BillWagner moved this from 🏗 In progress to 👀 In review in dotnet/docs January 2025 sprint project Jan 16, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 16, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Jan 16, 2025
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in dotnet/docs January 2025 sprint project Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csharp-linq/subsvc dotnet-csharp/svc in-pr This issue will be closed (fixed) by an active pull request. okr-freshness OKR: Freshness of content okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
Status: Slipped
Development

Successfully merging a pull request may close this issue.

2 participants