📙
Learn EF Core 9
  • Introduction of Entity Framework Core
  • EF Core - AI Tools
  • What's New in EF Core 5
    • Simple Logging
    • Filtered Included
    • Backing Fields
    • Keyless Entity Types
    • Configure Precision and Scale
    • Translation of Contains on byte arrays
    • Many-to-many Relationship
    • Table-per-type (TPT) mapping
    • Required one-to-one Dependents
    • Support for Fields using Lambda
    • Drop Column from SQLite Database
    • Index Attribute
  • BulkExtensions in EF Core
  • Connection Strings: Entity Framework Core
  • Entity Framework Core Model
  • DbContext
  • DbSet
  • Relationship in EF-Core
  • Lazy Loading in EF Core
  • Migrations in EF-Core
  • Handling Concurrency in EF-Core
  • Raw SQL Queries in EF-Core
  • Database Providers
    • SQL Server
    • SQLite
    • InMemory
    • Cosmos
    • PostgreSQL
  • Project Types
    • Console
    • MVC
    • WinForm
    • Xamarin
    • Blazor
Powered by GitBook
On this page
  • How to create a Bulk Operations?
  • Why using Bulk Operations in EF Core?
  • References

BulkExtensions in EF Core

PreviousIndex AttributeNextConnection Strings: Entity Framework Core

Last updated 1 year ago

In EF Core, if you want to improve your CRUD performance, you need to call from the library made by .

They provide all common bulk extensions required when working with EF Core:

And even more features through their free library .

How to create a Bulk Operations?

Without options, it's pretty simple. Instead of tracking your entities, you simply pass it to one of their methods, such as Bulk Insert:

context.BulkInsert(customers);

If you need an option like including all your entities graph, you need to create a lambda expression such as:

context.BulkInsert(customers, options => { options.IncludeGraph = true});

Why using Bulk Operations in EF Core?

The main reason people need to use Bulk Operations in EF Core is to improve their performance when importing thousand of entities. In addition to saving data, you also reduce your memory usage.

When processing a lot of entities, using Bulk Extensions instead of SaveChanges can be 5 times faster and use 20% of the memory.

References

BulkExtensions
ZZZ Projects
Bulk SaveChanges
Bulk Insert
Bulk Update
Bulk Delete
Bulk Merge
Bulk Synchronize
Bulk Read
Where Bulk Contains
Where Bulk Not Contains
Entity Framework Plus
EFCore BulkExtensions
EF Core BulkExtensions Download