Skip to content

Implement DateOnly.DayNumber translations for SqlServer/Sqlite #36189

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

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

roji
Copy link
Member

@roji roji commented Jun 5, 2025

Tried to implement for Cosmos as well, but their DateTimeDiff function doesn't seem to work for timestamps before the year 1601 (and we need to calculate the number of days from 0001-01-01.

Closes #36183

@roji roji requested a review from a team as a code owner June 5, 2025 11:11
@roji roji enabled auto-merge (squash) June 5, 2025 11:11
roji added a commit to roji/EntityFramework.Docs that referenced this pull request Jun 5, 2025
roji added a commit to roji/EntityFramework.Docs that referenced this pull request Jun 5, 2025
@roji
Copy link
Member Author

roji commented Jun 5, 2025

Doc PR: dotnet/EntityFramework.Docs#5042

instance
],
nullable: true,
argumentsPropagateNullability: [false, true, true],
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be [false, false, true]?

Copy link
Member Author

Choose a reason for hiding this comment

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

It could be - it doesn't matter either way, as the second argument is a non-null constant (and so the logic handling null semantics will do the right thing anyway). Up to now I've been generally specifying the function behavior in argumentsPropagateNullability, without taking the actual arguments into account - but let me know if you think we should do something else.

Copy link
Contributor

Choose a reason for hiding this comment

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

Up to you.

@roji roji merged commit 1d37b05 into dotnet:main Jun 9, 2025
7 checks passed
@roji roji deleted the DateOnlyDayNumber branch June 9, 2025 09:15
cincuranet pushed a commit to dotnet/EntityFramework.Docs that referenced this pull request Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support DateOnly.DayNumber translation
2 participants