Tutorial: Choosing between tuples, records, structs, and classes#53160
Draft
BillWagner wants to merge 5 commits intodotnet:mainfrom
Draft
Tutorial: Choosing between tuples, records, structs, and classes#53160BillWagner wants to merge 5 commits intodotnet:mainfrom
BillWagner wants to merge 5 commits intodotnet:mainfrom
Conversation
Add an example of an inheritance scenario in this tutorial.
Discuss how you can change these decisions over time.
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