Support for DateTime built-in operations in LINQ to Entities
Some customers want to write queries that include such expressions as "date1 - date2" or "datetime3 + timespan1 > datetime4". LINQ to Entities currently support some of date/time operations through the EntityFunctions.AddX and DiffX functions, but it doesn't support built-in operators with data/time types.
Entity Framework should support using very common BCL features such as DateTime.Date in LINQ queries. Right now this requires the use of the special TruncateTime function.
The problems are as follows:
- This feels unnatural.
- It also is a problem when migrating from LINQ to SQL which did support DateTime.Date.
- It makes moving code across LINQ providers harder (e.g. move a piece of code from LINQ to objects to EF in order to remote it to the SQL Server)
Other common features should be supported as well. For example DateTime.Year or TimeSpan stuff.
Some are already supported such as Guid.NewGuid. That's good.