How to do a Bulk Insert — Linq to Entities

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

    For a perfect example of how to do bulk inserts with LINQ to Entities, see http://archive.msdn.microsoft.com/LinqEntityDataReader. It is a wrapper that allows easy use of SqlBulkCopy.

    @Marc Gravell is correct, sometimes you have to mix models to get the job done.

提交回复
热议问题