Batching DB commands in Entity Framework 4.0

后端 未结 5 986
野趣味
野趣味 2020-11-28 13:51

My current project requires everyday synchronization with external system. The synchronization is based on complex import file structure which is parsed and processed with e

5条回答
  •  迷失自我
    2020-11-28 14:29

    Just sharing with you a GitHub project just for that, as of now, it supports Bulk insert/update/delete for Sql server transparently using SqlBulkCopy. https://github.com/MHanafy/EntityExtensions There're other goodies as well, and hopefully, It will be extended to do more down the track. Using it is as simple as

    var insertsAndupdates = new List();
    var deletes = new List();
    context.BulkUpdate(insertsAndupdates, deletes);
    
    
    

    Hope it helps!

    提交回复
    热议问题