在实体框架核心中批量插入MySQL [英] Bulk-Insert to MySQL in Entity-Framework Core
问题描述
我有一个包含约10,000个对象(例如类Person
)的列表,需要将其插入到MySQL表中.如果我使用常规的DbContext.SaveChanges()
,则需要60-70秒的时间发布,因此我需要大幅度减少.我发现了批量插入的几个扩展名:
- EF扩展(不是免费的,所以没有选择)
- BulkExtensions (没有MySQL,只有SQL Server)
- EFBulkInsert (没有MySQL,只有SQL Server) ...
不幸的是,MySQL数据库似乎不存在这种情况.有人知道MySQL吗?如果没有,谁能给我一种解决方法,使我自己制作或调整上述解决方案?谢谢!
幸运的是,现在免费提供:
EF6.BulkInsert.MySql 6.1.0.6 durch Vitor Ortuondo
BulkInsert.EF6.MySql 6.0.4 durch Kinshines >
I have a list consisting of ~10,000 objects (let's say of class Person
) that I need to insert to a MySQL table. If I use the regular DbContext.SaveChanges()
, it takes 60-70 seconds to issue, which I need to reduce drastically. I've found several extensions for bulk-insertions:
- EF extensions (not free, so no option)
- BulkExtensions (no MySQL, only SQL Server)
- EFBulkInsert (no MySQL,only SQL Server) ...
Unfortunately, non seem to exist for MySQL databases. Does anybody know of one for MySQL? If not, could anyone give me an approach as to how I could make my own or adjust the aforementioned solutions? Thank you!
Fortunately it is available now for free:
EF6.BulkInsert.MySql 6.1.0.6 durch Vitor Ortuondo
BulkInsert.EF6.MySql 6.0.4 durch Kinshines
这篇关于在实体框架核心中批量插入MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!