I am using EF6
and due to the low speed of AddRange()
method I need to use BulkInsert
. So I added the NuGet package of BulkInsert for
The "BulkInsert" library is very fast but not very flexible and unsupported.
It doesn't support all type of inheritance (TPC, TPT) and has some issue with column mapping.
The issue you got is for one of these reasons.
Disclaimer: I'm the owner of the project Entity Framework Extensions
This library is the ultimate library for performance and allow to:
All inheritance and association are supported.
Example:
using (var db = new Entities(myConnectionString)
{
db.BulkInsert(contactsToInsert);
}
// BulkSaveChanges is slower than BulkInsert but way faster then SaveChanges
using (var db = new Entities(myConnectionString))
{
db.Contacts.AddRange(contactsToInsert);
db.BulkSaveChanges();
}