Can EF4 support batch updates?

前端 未结 3 715
一生所求
一生所求 2021-01-01 22:58

Does Entity Framework v4 support batch updates/inserts so rather than sending >1 command to a db, it can send >1 command to the DB in one go?

Thanks

相关标签:
3条回答
  • 2021-01-01 23:27

    I don't believe that has changed. You have the options of:

    • Stored Procedures
    • Stuff like this article
    • Using T-Sql like in the answer of this question
    0 讨论(0)
  • 2021-01-01 23:43

    I believe that can be accomplished by adding multiple Entity to the context and calling save changes.

    context.ApplyChanges<T>("Order", obj1);
    context.ApplyChanges<T>("Order", obj2);
    context.SaveChanges();
    
    0 讨论(0)
  • 2021-01-01 23:48

    I discovered a good answer to this question here: Paul Welter shows how to use EntityFramework.Extended

    0 讨论(0)
提交回复
热议问题