-
Notifications
You must be signed in to change notification settings - Fork 6k
Add DateOnly guidance and examples to indexers documentation #47727
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: BillWagner <[email protected]>
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.
This is a good start, but I have some change you should make.
docs/csharp/programming-guide/indexers/snippets/indexers/Indexers.csproj
Outdated
Show resolved
Hide resolved
docs/csharp/programming-guide/indexers/snippets/indexers/indexer-2.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: BillWagner <[email protected]>
docs/csharp/programming-guide/indexers/snippets/indexers/Indexers.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: BillWagner <[email protected]>
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.
This is ready for final review and merge.
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.
This is ready for final review and merge.
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.
This is ready for final review and merge.
This PR addresses the need to update the indexers documentation to mention DateOnly as an alternative to DateTime when only date information is required.
Changes Made
Added a new "Date-based indexers" section to the indexers documentation that provides:
DateOnly
vsDateTime
in indexer scenariosDailyTemperatureData
class that demonstrates:DateOnly
for date-only data storageDateTime
overload that extracts only the date portionExample Usage
The implementation ensures that all temperature data for a given day is treated consistently, regardless of any time component, which addresses the core issue of when to prefer DateOnly over DateTime.
Technical Updates
Fixes #34187.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
Internal previews