-
-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SqlServer] BulkInsertOrUpdate does not insert in correct order and database IDs not assigned #806
Comments
EFCore.BulkExtensions/EFCore.BulkExtensions/SqlQueryBuilder.cs Lines 179 to 184 in 38a3c37
But when UpdateByProperties are configured then orderBy is done with those props instead of ID. var orderByCols = tableInfo.HasIdentity ? new List<string> { tableInfo.IdentityColumnName } : primaryKeys;
var orderBy = (orderByCols.Count() == 0) ? "" : $"ORDER BY {GetCommaSeparatedColumns(orderByCols)}"; But still it does not make proper order. |
Using the newest version (6.4.4) I have the problem that the order of the entities to be inserted is changed. Also the entities don't have the database IDs assigned (see Output section "newValuesFromMemory").
Given the following code:
Entities:
Context
Output
The text was updated successfully, but these errors were encountered: