Entity Framework Bulk Insert Throws KeyNotFoundException error

前端 未结 3 1047
借酒劲吻你
借酒劲吻你 2021-01-17 16:21

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

3条回答
  •  一个人的身影
    2021-01-17 17:15

    Ok, I had a same error couldnt find any answers online so had to look deep so here is what i figured:

    When your entity has an inherited and the child entities if not defined as part of the DBSet it flags an error such kind, secondly, not sure why it expects the new DbContext with just the related entity used for bulkInsertions if there is any other entities out there it raises the same error.

    So its the 2 cause so i had to fix these both, and running like an horse!!!

    its worth trying, so give a try

提交回复
热议问题