How to Bulk Update records in Entity Framework?

前端 未结 7 2203
遥遥无期
遥遥无期 2020-12-01 08:00

I am trying to bulk update records using Entity Framework. I have tried Entity Framework.Extensions Update method.

The Update method is abl

7条回答
  •  生来不讨喜
    2020-12-01 08:47

    Bulk Update can be done in three steps with simple EF instead of separate extension methods :-

    • Load all the entities first.
    • Foreach on each entity and change its field values.
    • After Foreach save the context changes once.

    This will send multiple Update queries in single batch.

提交回复
热议问题