Tutorial: Choosing between tuples, records, structs, and classes#53160
Open
BillWagner wants to merge 7 commits intodotnet:mainfrom
Open
Tutorial: Choosing between tuples, records, structs, and classes#53160BillWagner wants to merge 7 commits intodotnet:mainfrom
BillWagner wants to merge 7 commits intodotnet:mainfrom
Conversation
43953a4 to
af46fbb
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new C# Fundamentals tutorial that helps learners choose between tuples, record classes, record structs, classes, and interfaces using a coffee shop–based walkthrough, and surfaces the tutorial in the C# table of contents.
Changes:
- Added a new tutorial page (
choosing-types.md) with scenario-driven guidance and a quick decision table. - Added a runnable sample (
snippets/choosing-types/Program.cs) that demonstrates tuples, records, structs, classes, inheritance, and interfaces. - Updated
docs/csharp/toc.ymlto include the new tutorial under Fundamentals tutorials.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/csharp/toc.yml | Adds a TOC entry so the new tutorial is discoverable under Fundamentals tutorials. |
| docs/csharp/fundamentals/tutorials/choosing-types.md | Introduces the new tutorial content and references snippet regions for examples. |
| docs/csharp/fundamentals/tutorials/snippets/choosing-types/Program.cs | Provides the example code regions used throughout the tutorial. |
Add an example of an inheritance scenario in this tutorial.
Discuss how you can change these decisions over time.
Restructures this article to provide a better context and motivations.
Make sure the template was applied correctly and do a final copy edit.
af46fbb to
a65bf4c
Compare
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 #51996
This pull request introduces a new tutorial to the C# Fundamentals documentation that helps developers choose between tuples, records, structs, classes, and interfaces by walking through a practical coffee shop example. It includes a comprehensive, example-driven guide, a complete code sample, and updates the table of contents to surface the new material.
New tutorial and code sample:
choosing-types.md, that explains when to use tuples, record classes, record structs, classes, and interfaces, with practical examples and a decision guide table.snippets/choosing-types/Program.csthat demonstrates each type in context, including tuples, records, structs, classes, and interfaces.Documentation navigation:
toc.yml) to add the new tutorial under the Fundamentals section for easier discovery.Internal previews