Skip to content

Add DateOnly.FromDateTime query mapping for SQL Server - #31180

Merged
roji merged 5 commits into
dotnet:mainfrom
ErikEJ:issue-30708
Jul 4, 2023
Merged

Add DateOnly.FromDateTime query mapping for SQL Server#31180
roji merged 5 commits into
dotnet:mainfrom
ErikEJ:issue-30708

Conversation

@ErikEJ

@ErikEJ ErikEJ commented Jul 3, 2023

Copy link
Copy Markdown
Contributor

fixes #30708

@ErikEJ ErikEJ changed the title Add DateOnly.FormDateTime query mapping for SQL Server Add DateOnly.FromDateTime query mapping for SQL Server Jul 3, 2023

@roji roji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ErikEJ, looks good thanks.

FYI test test doesn't require a DateOnly in the model, only a DateTime, so it could simply be added to e.g. NorthwindFunctions to avoid adding DateTime to GearsOfWar and changing all the baselines.

Note that it should be pretty easy to implement this for SQLite as well, with the date() function (docs) - are you interested in doing that?

Comment thread test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs Outdated
…SqlServerTest.cs

Co-authored-by: Shay Rojansky <roji@roji.org>
@ErikEJ

ErikEJ commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

@roji Should I move the test?

@ErikEJ

ErikEJ commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

I will leave the SQLite implementation to someone else 😄

@ErikEJ

ErikEJ commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

I am moving the test

@roji

roji commented Jul 4, 2023

Copy link
Copy Markdown
Member

@ErikEJ pushed a commit that implements for SQLite and asserts failure for Cosmos.

@ErikEJ

ErikEJ commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

Cool, thanks

@roji
roji merged commit 99d0c74 into dotnet:main Jul 4, 2023
@roji

roji commented Jul 4, 2023

Copy link
Copy Markdown
Member

Thanks as always @ErikEJ!

@ErikEJ

ErikEJ commented Jul 6, 2023

Copy link
Copy Markdown
Contributor Author

@roji Tag "community-contribution"?

@roji

roji commented Jul 6, 2023

Copy link
Copy Markdown
Member

Added

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.

Translate DateOnly.FromDateTime

2 participants