BulkExtensions in EF Core
Last updated
Last updated
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 .
Without options, it's pretty simple. Instead of tracking your entities, you simply pass it to one of their methods, such as Bulk Insert:
If you need an option like including all your entities graph, you need to create a lambda expression such as:
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.