如何做批量插入 - 临床到实体 [英] How to do a Bulk Insert -- Linq to Entities

查看:97
本文介绍了如何做批量插入 - 临床到实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到关于如何使用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.

这篇关于如何做批量插入 - 临床到实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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