How to do a Bulk Insert — Linq to Entities

前端 未结 4 1048
北海茫月
北海茫月 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:36

    Sometimes you simply have to mix models. Perhaps use SqlBulkCopy for this part of your repository (since this plugs directly into the bulk-copy API), and Entity Framework for some of the rest. And if necessary, a bit of direct ADO.NET. Ultimately the goal is to get the job done.

提交回复
热议问题