How to do a Bulk Insert — Linq to Entities

前端 未结 4 1055
北海茫月
北海茫月 2020-11-27 16:23

I cannot find any examples on how to do a Bulk/batch insert using Linq to Entities. Do you guys know how to do a Bulk Insert?

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 16:32

    I wrote a class that will bulk insert EF entities (or any kind of object as long as the property names match the column names).

    The class supports customizing the batch size, pre & post insert events, queued inserts, and "firehose mode" (give it a billion objects, it will respect the batch size).

    • The code: BulkInserter
    • How to use it

提交回复
热议问题