Skip to content

Commit d5e1d19

Browse files
authored
Document new DateOnly.DayNumber translations (#5042)
See dotnet/efcore#36189
1 parent 3a161a5 commit d5e1d19

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

entity-framework/core/providers/sql-server/functions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ dateOnly.Day | DATEPART(day, @dat
127127
dateOnly.DayOfYear | DATEPART(dayofyear, @dateOnly) | EF Core 8.0
128128
dateOnly.Month | DATEPART(month, @dateOnly) | EF Core 8.0
129129
dateOnly.Year | DATEPART(year, @dateOnly) | EF Core 8.0
130+
dateOnly.DayNumber | DATEDIFF(day, '0001-01-01', @dateOnly) | EF Core 10.0
130131
EF.Functions.AtTimeZone(dateTime, timeZone) | @dateTime AT TIME ZONE @timeZone | EF Core 7.0
131132
EF.Functions.DateDiffDay(start, end) | DATEDIFF(day, @start, @end)
132133
EF.Functions.DateDiffHour(start, end) | DATEDIFF(hour, @start, @end)

entity-framework/core/providers/sqlite/functions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ dateOnly.DayOfYear | strftime('%j', @dateOnly)
7272
DateOnly.FromDateTime(dateTime) | date(@dateTime) | EF Core 8.0
7373
dateOnly.Month | strftime('%m', @dateOnly)
7474
dateOnly.Year | strftime('%Y', @dateOnly)
75+
dateOnly.DayNumber | CAST(julianday(@dateOnly) - julianday('0001-01-01') AS INTEGER) | EF Core 10.0
7576
DateTime.Now | datetime('now', 'localtime')
7677
DateTime.Today | datetime('now', 'localtime', 'start of day')
7778
DateTime.UtcNow | datetime('now')

entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ See [#12793](https://github.com/dotnet/efcore/issues/12793) and [#35367](https:/
130130

131131
### Other query improvements
132132

133-
- Translate DateOnly.ToDateTime(timeOnly) ([#35194](https://github.com/dotnet/efcore/pull/35194), contributed by [@mseada94](https://github.com/mseada94)).
133+
- Translate [DateOnly.ToDateTime()](/dotnet/api/system.dateonly.todatetime) ([#35194](https://github.com/dotnet/efcore/pull/35194), contributed by [@mseada94](https://github.com/mseada94)).
134+
- Translate [DateOnly.DayNumber](/dotnet/api/system.dateonly.daynumber) and `DayNumber` subtraction for SQL Server and SQLite ([#36183](https://github.com/dotnet/efcore/issues/36183)).
134135
- Optimize multiple consecutive `LIMIT`s ([#35384](https://github.com/dotnet/efcore/pull/35384), contributed by [@ranma42](https://github.com/ranma42)).
135136
- Optimize use of `Count` operation on `ICollection<T>` ([#35381](https://github.com/dotnet/efcore/pull/35381), contributed by [@ChrisJollyAU](https://github.com/ChrisJollyAU)).
136137
- Optimize `MIN`/`MAX` over `DISTINCT` ([#34699](https://github.com/dotnet/efcore/pull/34699), contributed by [@ranma42](https://github.com/ranma42)).

0 commit comments

Comments
 (0)