Skip to content

Move includes only used once into their articles#51944

Open
adegeo wants to merge 2 commits intomainfrom
adegeo/dateonly-and-timeonly-includes/50697
Open

Move includes only used once into their articles#51944
adegeo wants to merge 2 commits intomainfrom
adegeo/dateonly-and-timeonly-includes/50697

Conversation

@adegeo
Copy link
Contributor

@adegeo adegeo commented Feb 26, 2026

Copilot AI review requested due to automatic review settings February 26, 2026 23:50
@adegeo adegeo requested a review from a team as a code owner February 26, 2026 23:50
@dotnetrepoman dotnetrepoman bot added this to the February 2026 milestone Feb 26, 2026
@adegeo adegeo enabled auto-merge (squash) February 26, 2026 23:50
Copy link
Contributor

Copilot AI left a 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 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:
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Copilot uses AI. Check for mistakes.
[!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:
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM @adegeo

Let's :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two odd includes - Investigate

3 participants