BulkInsert for Entity Framework Core

Greg Frazer 0 Reputation points
2024-07-03T23:37:18.52+00:00

Entity Framework core now has ExecuteUpdate and ExecuteDelete for doing large updates and deletes
But when is EF core going to get the much need BulkInsert that does the job of SQL SERVER's BCP

There are third party tools, but they are very expense and a little buggy

Please advise or consider a plan

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
779 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Hongrui Yu-MSFT 4,930 Reputation points Microsoft External Staff
    2024-07-04T03:24:45.1066667+00:00

    Hi,@Greg Frazer. Welcome to Microsoft Q&A. 

    Whether to allow EF to have Bulk functionality is discussed in the following link. You can refer to it:

    Does EF Core support bulk-insert/update/delete? · Issue #7256 · dotnet/efcore (github.com)

     

    In this discussion, the Bulk function will still be postponed.

     

    The current temporary solution is still to use the three-party library mentioned above.

    EFCore.BulkExtensions: https://github.com/borisdj/EFCore.BulkExtensions

    EntityFramework.Extended: https://github.com/zzzprojects/EntityFramework.Extended


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Jonathan Magnan 0 Reputation points
    2025-03-12T15:28:03.72+00:00

    Hello @Anonymous ,

    If you are looking for a method that work like ExecuteUpdate and ExecuteDelete , but for the insert, you can try our InsertFromQuery feature, it is 100% free

    Otherwise, if you are looking to insert multiple entities, you can use the SqlBulkCopy (which is free) or use a third-party library that you are probably aware of, such as the Bulk Insert or Bulk Insert Optimized methods offered by EFE. You can always contact us directly to see what we can offer if the library is too expensive for your needs.

    Disclaimer: I'm the owner of Entity Framework Extensions

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.