Move includes only used once into their articles#51944
Conversation
There was a problem hiding this comment.
Pull request overview
This PR eliminates unnecessary include files by inlining content that was only referenced once. The linked issue (#50697) identified two include files (dateonly-and-timeonly-serialization.md and dateonly-and-timeonly-serialization-cs.md) that were each used in only one location, making them candidates for removal.
Changes:
- Deleted two single-use include files in the
docs/standard/datetime/includes/directory - Inlined the DateOnly and TimeOnly serialization content into the two articles that referenced them
- Added HTML comments noting that content is duplicated between the two articles
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/standard/datetime/system-text-json-support.md | Replaced include reference with inline content (C# only) |
| docs/standard/datetime/how-to-use-dateonly-timeonly.md | Replaced include reference with inline content (C# and VB) |
| docs/standard/datetime/includes/dateonly-and-timeonly-serialization.md | Deleted (was only used once) |
| docs/standard/datetime/includes/dateonly-and-timeonly-serialization-cs.md | Deleted (was only used once) |
| ## Serialize DateOnly and TimeOnly properties | ||
|
|
||
| [!INCLUDE [dateonly-and-timeonly-serialization-cs](includes/dateonly-and-timeonly-serialization-cs.md)] | ||
| Starting ith .NET 7, `System.Text.Json` supports serializing and deserializing <xref:System.DateOnly> and <xref:System.TimeOnly> types. Consider the following object: |
There was a problem hiding this comment.
There's a typo in "Starting ith .NET 7" - it should be "Starting in .NET 7" (missing 'w' in 'with'). Note: According to the style guide, the correct phrasing is "Starting in .NET X" not "Starting with .NET X".
| [!INCLUDE [dateonly-and-timeonly-serialization](includes/dateonly-and-timeonly-serialization.md)] | ||
| <!-- This section is somewhat duplicated in system-text-json-support.md section 'Serialize DateOnly and TimeOnly properties' --> | ||
|
|
||
| Starting with .NET 7, `System.Text.Json` supports serializing and deserializing <xref:System.DateOnly> and <xref:System.TimeOnly> types. Consider the following object: |
There was a problem hiding this comment.
The phrasing "Starting with .NET 7" should be "Starting in .NET 7" to follow the style guide convention. Use "in" not "with" when introducing version-specific features.
Summary
Fixes #50697
Internal previews