问题:
I'm looking for the fastest way of inserting into Entity Framework. 我正在寻找插入实体框架的最快方法。
I'm asking this because of the scenario where you have an active TransactionScope and the insertion is huge (4000+). 我之所以这样问,是因为您有一个活动的TransactionScope且插入量很大(超过4000个)。 It can potentially last more than 10 minutes (default timeout of transactions), and this will lead to an incomplete transaction. 它可能会持续10分钟以上(事务默认超时),这将导致事务不完整。
解决方案:
参考一: https://stackoom.com/question/OvK5/在实体框架中最快的插入方式参考二: https://oldbug.net/q/OvK5/Fastest-Way-of-Inserting-in-Entity-Framework
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4358002