Consolidate C# statements documentation - #55616
Draft
BillWagner wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates and rewires C# statements and expression-bodied members content by moving statements coverage into the Fundamentals section, making the lambda operator page the canonical location for expression body definitions, and adding redirects/TOC updates to preserve navigation and links.
Changes:
- Add a new Fundamentals statements overview article and runnable snippet project, and update TOC to surface the new statements content under “Expressions and statements”.
- Replace references to the removed Expression-bodied members programming-guide article with links to the lambda operator’s “Expression body definition” section, and add redirects for removed pages.
- Remove legacy programming-guide statements content and older snippet assets that are no longer referenced.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideStatements/CS/Statements.cs | Removes legacy statements/equality sample source that’s no longer referenced by docs. |
| samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideStatements/CS/Program.cs | Removes legacy snippet runner entry point. |
| samples/snippets/csharp/programming-guide/classes-and-structs/ExpressionBodiedMembers/Program.cs | Removes legacy expression-bodied members snippet runner entry point. |
| samples/snippets/csharp/programming-guide/classes-and-structs/ExpressionBodiedMembers/expr-bodied-readonly.cs | Removes legacy expression-bodied members snippet source. |
| samples/snippets/csharp/programming-guide/classes-and-structs/ExpressionBodiedMembers/expr-bodied-methods.cs | Removes legacy expression-bodied members snippet source. |
| samples/snippets/csharp/programming-guide/classes-and-structs/ExpressionBodiedMembers/expr-bodied-indexers.cs | Removes legacy expression-bodied members snippet source. |
| samples/snippets/csharp/programming-guide/classes-and-structs/ExpressionBodiedMembers/expr-bodied-event.cs | Removes legacy expression-bodied members snippet source. |
| samples/snippets/csharp/programming-guide/classes-and-structs/ExpressionBodiedMembers/expr-bodied-ctor.cs | Removes legacy expression-bodied members snippet source. |
| docs/fundamentals/code-analysis/style-rules/ide0061.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/fundamentals/code-analysis/style-rules/ide0053.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/fundamentals/code-analysis/style-rules/ide0027.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/fundamentals/code-analysis/style-rules/ide0026.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/fundamentals/code-analysis/style-rules/ide0025.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/fundamentals/code-analysis/style-rules/ide0023-ide0024.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/fundamentals/code-analysis/style-rules/ide0022.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/fundamentals/code-analysis/style-rules/ide0021.md | Retargets expression-bodied guidance links to the lambda operator article. |
| docs/csharp/whats-new/csharp-version-history.md | Updates links for statements and expression-bodied members to new canonical locations. |
| docs/csharp/toc.yml | Adds Fundamentals statements nodes and removes obsolete programming-guide entries. |
| docs/csharp/programming-guide/statements-expressions-operators/statements.md | Removes the legacy programming-guide statements article (replaced by Fundamentals). |
| docs/csharp/programming-guide/statements-expressions-operators/snippets/equality-comparisons/Program.cs | Adds a focused snippet used by equality comparisons docs. |
| docs/csharp/programming-guide/statements-expressions-operators/snippets/equality-comparisons/equality-comparisons.csproj | Updates the snippet project configuration for the new snippet. |
| docs/csharp/programming-guide/statements-expressions-operators/expression-bodied-members.md | Removes the legacy programming-guide expression-bodied members article (replaced by lambda operator section + redirect). |
| docs/csharp/programming-guide/statements-expressions-operators/equality-comparisons.md | Switches to the new local snippet include format/source. |
| docs/csharp/programming-guide/classes-and-structs/constructors.md | Retargets expression-bodied constructor links to the lambda operator article. |
| docs/csharp/misc/cs1002.md | Updates explanation, adds ai-usage, and points “Statements” to Fundamentals. |
| docs/csharp/language-reference/statements/selection-statements.md | Retargets expression-bodied link to the lambda operator article. |
| docs/csharp/language-reference/operators/null-coalescing-operator.md | Retargets expression-bodied link to the lambda operator article. |
| docs/csharp/language-reference/operators/lambda-operator.md | Expands/clarifies expression body definition content and adds ai-usage. |
| docs/csharp/language-reference/operators/index.md | Retargets “statement” and expression body definition references to new locations. |
| docs/csharp/language-reference/operators/default.md | Retargets expression-bodied link to the lambda operator article. |
| docs/csharp/language-reference/keywords/statement-keywords.md | Retargets statements link to Fundamentals. |
| docs/csharp/language-reference/compiler-messages/cs0201.md | Retargets statements link to Fundamentals. |
| docs/csharp/fundamentals/types/built-in-types.md | Adds a temporary “See also” comment block related to pending link wiring. |
| docs/csharp/fundamentals/tutorials/nullable-reference-types.md | Retargets expression-bodied link to the lambda operator article. |
| docs/csharp/fundamentals/statements/snippets/statements-overview/statements-overview.csproj | Updates the statements snippet project target/framework settings. |
| docs/csharp/fundamentals/statements/snippets/statements-overview/Program.cs | Adds runnable snippet content for expression statements and block scope. |
| docs/csharp/fundamentals/statements/index.md | Adds the new Fundamentals “Statements in C#” overview article. |
| docs/csharp/fundamentals/program-structure/index.md | Retargets statements and expression-bodied links to new canonical locations. |
| docs/csharp/fundamentals/null-safety/null-operators.md | Adds a temporary “See also” comment block related to pending link wiring. |
| .openpublishing.redirection.csharp.json | Adds redirects for removed programming-guide pages and adjusts an existing redirect target. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
540
to
544
| - name: Statements, expressions, and equality | ||
| items: | ||
| - name: Statements | ||
| href: programming-guide/statements-expressions-operators/statements.md | ||
| - name: Expression-bodied members | ||
| href: programming-guide/statements-expressions-operators/expression-bodied-members.md | ||
| - name: Equality and equality comparisons | ||
| items: | ||
| - name: Equality comparisons |
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.
Fixes #55336
Finish the fundamentals sections for expressions and statements.
Internal previews
Toggle expand/collapse