Batching DB commands in Entity Framework 4.0

后端 未结 5 1006
野趣味
野趣味 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条回答
  •  猫巷女王i
    2020-11-28 14:19

    No, it can't be done (yes - i weep also).

    EF does not support batch operations, LINQ-SQL had (has) the same problem.

    You've got a few options:

    1. Stored Procedures
    2. Classic ADO.NET or EntitySQL
    3. Triggers

    I've gone with option 1 and 3 in the past.

    The problem with all three approaches is you lose the EF abstraction, the internal graph (optimistic concurrency), and your brought back to the world of native SQL.

提交回复
热议问题