Skip to content

AddRange advice is BS #6

Open
Open
@DickBaker

Description

@DickBaker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions