Skip to content

Translate DateTimeOffset.ToUnixTime[Seconds|Milliseconds] - #28978

Merged
bricelam merged 2 commits into
dotnet:mainfrom
Marusyk:rmarusyk/28925
Mar 30, 2023
Merged

Translate DateTimeOffset.ToUnixTime[Seconds|Milliseconds] #28978
bricelam merged 2 commits into
dotnet:mainfrom
Marusyk:rmarusyk/28925

Conversation

@Marusyk

@Marusyk Marusyk commented Sep 4, 2022

Copy link
Copy Markdown
Member

Added translation for DateTimeOffset.ToUnixTime[Seconds|Milliseconds]

Fixes #28925

Could anyone help me improve the tests?
Thank you in advance

@Marusyk
Marusyk requested a review from dougbu as a code owner September 4, 2022 01:32
@Marusyk
Marusyk changed the base branch from release/7.0 to main September 4, 2022 01:34
roji
roji previously requested changes Sep 4, 2022

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

See also SQLite test failures, you probably need to implement those tests and assert on them failing (unless there's a translation on SQLite as well).

Comment thread src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMethodTranslator.cs Outdated
Comment thread src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMethodTranslator.cs Outdated
@ajcvickers

Copy link
Copy Markdown
Contributor

Marked as blocked since we shouldn't merge until we are actively working in main again.

Comment thread src/EFCore.SqlServer/Query/Internal/SqlServerDateTimeMethodTranslator.cs Outdated
Comment thread test/EFCore.Specification.Tests/Query/NorthwindFunctionsQueryTestBase.cs Outdated
Comment thread test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs Outdated
@smitpatel

Copy link
Copy Markdown
Contributor

Cosmos has DateTimeToTicks which returns ticks since unix epoch though not sure if Cosmos can handle DateTimeOffset as a type. Add translation if it is supported.

@roji

roji commented Sep 7, 2022

Copy link
Copy Markdown
Member

Converting to draft for now as we're not merging this for 7.0.

@roji
roji marked this pull request as draft September 7, 2022 06:43
Comment thread test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs Outdated
Comment thread test/EFCore.Sqlite.FunctionalTests/Query/NorthwindFunctionsQuerySqliteTest.cs Outdated
Comment thread src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeAddTranslator.cs Outdated
Comment thread src/EFCore.Sqlite.Core/Query/Internal/SqliteDateTimeAddTranslator.cs Outdated
@Marusyk

Marusyk commented Nov 11, 2022

Copy link
Copy Markdown
Member Author

Can I mark it "ready for review"?

@bricelam
bricelam marked this pull request as ready for review December 9, 2022 21:27
@bricelam bricelam removed the blocked label Dec 9, 2022
bricelam added a commit to Marusyk/efcore that referenced this pull request Mar 20, 2023
@bricelam

bricelam commented Mar 20, 2023

Copy link
Copy Markdown
Contributor

Rebased, removed SQLite translations, and propagated the type mapping from instance to UnixEpoch.

bricelam added a commit to Marusyk/efcore that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment