Allows fast insertion of entities in bulk with retrieval of the generated identity column.
Install-Package EFBulkInsert -Version 0.4.0
dotnet add package EFBulkInsert --version 0.4.0
<PackageReference Include="EFBulkInsert" Version="0.4.0" />
dbContext.BulkInsert(entites);
dbContext.BulkInsert(entities, 10000); // bulk insert with batch size of 10000
Performance improvements
# of entities | BulkInsert | EF SaveChanges |
---|---|---|
1000 | 127 ms | 493 ms |
5000 | 153 ms | 2573 ms |
10000 | 191 ms | 4214 ms |
50000 | 485 ms | 22542 ms |
100000 | 871 ms | 41374 ms |
500000 | 3916 ms | N/A |
1000000 | 7769 ms | N/A |
Tests made with: SQL Server 2016, EntityFramework 6.1.3 and EFBulkExtensions 0.1.0.
- Added: Support for Entity Framework Core 3.1.0
- Added: Support for schemas
- Fixed: Inserting into tables without identity columns
- Fixed: Retrieving the table name from EF metadata
- Fixed: Support for transactions
- Initial release