-
Notifications
You must be signed in to change notification settings - Fork 255
Milestone
Description
Introduction
Well, it's pretty weird example, but whatever. As soon as there is a translation DateOnly to date type it could be useful to allow to translate DateOnly.DayNumber - DateOnly.DayNumber to date - date. Luckily, both operations return integer number as a result.
Pros
- Return the difference between two DateOnly columns directly from database
- Align the translation behavior with
DateTime - DateTimeandDateTimeOffset - DateTimeOffset - Allow ordering by the substruction result directly by the database engine
Cons
Unfortunately, DateOnly type itself does not support a substruction operator, only using DayNumber property and code written in a such way looks a little bit clunky and unobvious. Considering this, the translation could be implemented as an extension for EF.DbFunctions class.
mojtabakaviani