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

AddRange advice is BS #6

Open
DickBaker opened this issue Sep 3, 2021 · 0 comments
Open

AddRange advice is BS #6

DickBaker opened this issue Sep 3, 2021 · 0 comments

Comments

@DickBaker
Copy link
Contributor

p65 of the pbook states ".. make sure you're leveraging batching (e.g. calling the AddRange() on your DbSet collections ..EF Core will then create a TVP and MERGE.." which IMHO is rubbish. Invoking AddRange rather than multiple Add calls probably more efficient, but surely has no consequence for batching which is achieved [much] later at SaveChanges time when the ChangeTracker discovers changes (via DetectChanges) and then sends the ordered & optimised TSQL to back-end db.

Batching is discussed here
https://docs.microsoft.com/en-us/ef/core/performance/efficient-updating

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

1 participant