-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Use snippets in article #50263
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
Use snippets in article #50263
Conversation
Responding to dotnet#50244 These files should remain in the repo, and should generally be included in the article
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR integrates code snippets from separate files into the XML documentation tutorial article, replacing inline code examples with references to full source files. The changes improve maintainability by using the standard snippet reference pattern instead of duplicating code in the documentation.
Key changes:
- Added snippet references to the markdown article for
Transactionrecord andBankAccountclass examples. - Updated derived classes (
InterestEarningAccount,LineOfCreditAccount,GiftCardAccount) to use<inheritdoc/>tags, demonstrating XML documentation inheritance. - Added snippet markers to
InterestEarningAccount.csto enable selective code inclusion in the article. - Cleaned up unnecessary comments from
BankAccount.cs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/csharp/fundamentals/tutorials/xml-documentation.md | Added code snippet references and link to source repository; removed inline code example for <inheritdoc/> usage |
| docs/csharp/fundamentals/tutorials/snippets/xml-documentation/BankAccount.cs | Removed extraneous comment line for cleaner code presentation |
| docs/csharp/fundamentals/tutorials/snippets/xml-documentation/InterestEarningAccount.cs | Added snippet markers and replaced detailed <summary> with <inheritdoc/> to demonstrate documentation inheritance |
| docs/csharp/fundamentals/tutorials/snippets/xml-documentation/LineOfCreditAccount.cs | Replaced detailed <summary> with <inheritdoc/> to demonstrate documentation inheritance pattern |
| docs/csharp/fundamentals/tutorials/snippets/xml-documentation/GiftCardAccount.cs | Replaced detailed <summary> with <inheritdoc/> to demonstrate documentation inheritance pattern |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Responding to #50244
These files should remain in the repo, and should generally be included in the article
Internal previews