153 votes16 comments · [Closed] Entity Framework Core Feature Suggestions · Flag idea as inappropriate… · Admin →mark commented
This is important.
A complication that needs to be solved is how to synchronize the in-memory entities with store entities. This should be possible using the OUTPUT clause in SQL Server.
For DELETE, output the keys for the deleted rows and update the in-memory entities.
For UPDATE, output the keys and written columns.
For INSERT, output everything.
There are two variations of bulk DML: DML by query (e.g. insert ... select) or client-provided data (e.g. SqlBulkCopy). In the latter case it might be necessary to write to a temp table first using SqlBulkCopy. After doing that the OUTPUT clause can be used in the actual DML statement.
One should be able to write:
as well as
192 votes12 comments · [Closed] Entity Framework Core Feature Suggestions · Flag idea as inappropriate… · Admin →
408 votes9 comments · [Closed] Entity Framework Core Feature Suggestions · Flag idea as inappropriate… · Admin →
Resurrecting this until we have true mapping to TVFs in EF Core.
Entity Framework Core supports invoking TVFs in a FromSql() call. But does not provide mapping for TVFs.
15 votes1 comment · [Closed] Entity Framework Core Feature Suggestions · Flag idea as inappropriate… · Admin →mark commented
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.