如何进行批量插入——Linq to Entities [英] How to do a Bulk Insert -- Linq to Entities

查看:29
本文介绍了如何进行批量插入——Linq to Entities的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到关于如何使用 Linq to Entities 进行批量/批量插入的任何示例.你们知道如何进行批量插入吗?

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?

推荐答案

有时您只需要混合模型.也许使用 SqlBulkCopy 用于存储库的这一部分(因为它直接插入批量复制 API),以及用于其余部分的实体框架.如有必要,直接使用 ADO.NET 位.最终目标是完成工作.

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.

这篇关于如何进行批量插入——Linq to Entities的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆