Skip to content
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

Double insert when SaveChanges after BulkInsert #77

Open
ealeykin opened this issue Jul 18, 2022 · 1 comment
Open

Double insert when SaveChanges after BulkInsert #77

ealeykin opened this issue Jul 18, 2022 · 1 comment

Comments

@ealeykin
Copy link

var uploader = new BulkUploader(context);
uploader.Insert(items); // first insert
context.SaveChanges(); // will insert items one more time

The snippet above shows minimal steps to reproduce, basically after bulk insert the state of entries remains Added and subsequent call to SaveChanges will apply all the changes (entries Added) one more time.

@dima-zhemkov
Copy link

dima-zhemkov commented Sep 1, 2022

I've got the same issue on 0.10.3.
EF Core 3.1.7

UPD:
It works when disableEntitiesTracking is set to true.
Why do we need this parameter?
In what cases it must be set to false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants