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

BulkInsert don't work for lazy-evaluated IEnumerable #1562

Open
KurinAlex opened this issue Sep 12, 2024 · 1 comment
Open

BulkInsert don't work for lazy-evaluated IEnumerable #1562

KurinAlex opened this issue Sep 12, 2024 · 1 comment
Labels

Comments

@KurinAlex
Copy link

When using BulkInsert on lazy-evaluated Enumerable (for example created using yield) no records are actually inserted in the database.
According to source code it happens due to enumeration calls to entities before insertion (for example, calling entities.Count()). These calls leads to early enumeration of IEnumerable and it is empty by the time of insertion.

@borisdj
Copy link
Owner

borisdj commented Nov 28, 2024

Can you make a test for this, and do you have suggestion for fix.
One thing that comes to mind is to have a config for this so that is can be skipped.
ActivitySources was added with this PR: #457

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

No branches or pull requests

2 participants