Closed kliukvinda closed 2 years ago
The query splitting behavior "SplitQueries" in projection (i.e. in Select
) is a new EF Core 6 feature.
EF creates the second query by cloning the query - and that's a problem. I'm loosing important information when the expressions are cloned.
On first glance, it doesn't look like I can fix it (easily) because there are no extensibility points when expressions are being cloned. At the moment I see no other way as disallowing of temp tables in queries with query splitting behavior "SplitQueries" to prevent invalid SQL statements.
Thinktecture.EntityFrameworkCore 4.0.0-beta01
dbContext configuration:
_context.BulkInsertIntoTempTableAsync:
call example:
in the first query the correct table name:
in the second query, the table name is incorrect and we get an error:
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name '#TempTable< int >'
Please see what the problem might be? Thanks.