[Everyday C#] Phase E, PR 14a: Statements: collections + LINQ#54807
Open
BillWagner wants to merge 6 commits into
Open
[Everyday C#] Phase E, PR 14a: Statements: collections + LINQ#54807BillWagner wants to merge 6 commits into
BillWagner wants to merge 6 commits into
Conversation
Phase E, PR 14a. Adds two example-heavy Fundamentals concept articles under fundamentals/statements/ with compiling net10.0 snippet projects: - collections.md: arrays, List<T>, Dictionary<TKey,TValue>, adding/ removing/searching elements, collection expressions (C# 12), indexes and ranges (C# 8). - linq.md: query syntax, method syntax, filter/map/reduce/sort/group, lambda expressions, deferred vs eager evaluation. Adds Collections and LINQ entries to the Expressions and statements TOC node. Advanced topics (providers, IQueryable, expression trees, PLINQ, performance, custom collections/operators) are intentionally left to the Language Reference and LINQ sections and linked out. Closes dotnet#53556 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f9f7f68-82b8-43d2-a511-1a4f07138403
Contributor
There was a problem hiding this comment.
Pull request overview
Adds two new “Everyday C#” Fundamentals concept articles under fundamentals/statements/ (Collections and LINQ), backed by new compiling snippet projects, and wires both pages into the C# TOC.
Changes:
- Adds new Fundamentals articles: Collections and LINQ queries.
- Adds new snippet projects (
collections-statementsandlinq-statements) that supply all referenced:::coderegions. - Updates
docs/csharp/toc.ymlto include the new pages under Fundamentals → Expressions and statements.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/csharp/toc.yml | Adds TOC entries for the new Collections and LINQ Fundamentals pages. |
| docs/csharp/fundamentals/statements/collections.md | New concept article introducing arrays, List<T>, dictionaries, collection expressions, and indexes/ranges with snippet-backed examples. |
| docs/csharp/fundamentals/statements/linq.md | New concept article introducing LINQ query/method syntax, common operators, grouping, and deferred execution with snippet-backed examples. |
| docs/csharp/fundamentals/statements/snippets/collections-statements/Program.cs | Snippet source for the Collections article :::code regions. |
| docs/csharp/fundamentals/statements/snippets/collections-statements/collections-statements.csproj | New net10.0 snippet project for Collections examples. |
| docs/csharp/fundamentals/statements/snippets/linq-statements/Program.cs | Snippet source for the LINQ article :::code regions. |
| docs/csharp/fundamentals/statements/snippets/linq-statements/linq-statements.csproj | New net10.0 snippet project for LINQ examples. |
Rename collections.md H1/title to "Arrays, lists, and dictionaries" to resolve the duplicate-H1 build warning, and collapse multiple-blank-line runs (MD012) in both statements articles. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f9f7f68-82b8-43d2-a511-1a4f07138403
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7f9f7f68-82b8-43d2-a511-1a4f07138403
This is looking a little better.
BillWagner
marked this pull request as ready for review
July 16, 2026 19:45
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Everyday C# — Phase E, PR 14a: Statements: collections + LINQ
Closes #53556
Adds two example-heavy Fundamentals concept articles under
fundamentals/statements/, each backed by a compilingnet10.0snippet project, and wires them into the TOC. Every code sample is included from an external snippet via:::coderegions and shows its result as a trailing// =>comment; the samples saturate the everyday feature set (collection expressions, file-scoped namespaces, nullable enabled, target-typednew).New articles
fundamentals/statements/collections.md— arrays,List<T>,Dictionary<TKey,TValue>; adding, removing, and searching elements; collection expressions (C# 12); indexes and ranges (C# 8) applied to collections. Introduces collection, element, sequence vs map, generic type / type safety, index, range, and collection expression at first use.fundamentals/statements/linq.md— query syntax and method (fluent) syntax; the functional trio filter / map / reduce mapped toWhere/Select/Aggregate·Sum·Count, plusOrderByandGroupBy; lambda (anonymous function) expressions in LINQ; deferred execution vs eager evaluation. Names LINQ providers as a first-class use and links out for provider-based queries.TOC
CollectionsandLINQadded under Fundamentals → Expressions and statements, afterIteration statements.Scope discipline — deliberately left out of Fundamentals (link-out targets)
No existing content was cut (both articles are new); the following advanced topics are intentionally kept out of Fundamentals and linked to their proper homes, per Goal 11 / Filter A:
collections.md→language-reference/builtin-types/arrays.md/collections.md→ multidimensional arrays, covariance, collection taxonomy are reference-level.collections.md→language-reference/operators/collection-expressions.md/member-access-operators.md→ conversion/spread rules and full[]/^/..operator rules are reference-level.collections.md→standard/collections/*→ choosing among specialized/concurrent/immutable collections and custom comparers fail universality.linq.md→linq/*(LINQ section) → joins, providers/IQueryable, deferred-execution mechanics, custom operators, XML/EF behavior are LINQ-focus material.linq.md→ PLINQ / expression trees / performance → parallel and advanced-representation material.Validation
net10.0; every// =>output verified by running the programs.#indexer-operator-anchor, and all<xref:...>UIDs verified to resolve; version claims (collection expressions → C# 12,^/..→ C# 8) confirmed.programming-guide/*link destinations (that area is slated for retirement).Opened as draft for review.
Internal previews