13

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

GurdeepS
  • 62,007
  • 101
  • 244
  • 379

3 Answers3

10

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

Community
  • 1
  • 1
Tim Hoolihan
  • 12,268
  • 3
  • 40
  • 54
  • 1
    I think the first or last option is probably the way to go (the second isn't really a batch) but note that the last option is TSQL, not ESQL. – Craig Stuntz Apr 27 '10 at 12:43
1

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

dugbugs
  • 36
  • 3
0

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();
John Egbert
  • 5,108
  • 7
  • 29
  • 44