I write 开发者_如何学Cthe following code with entity framework
context.AddObject(obj1);
context.AddObject(obj2);
context.DeleteObject(obj3);
context.SaveChanges();
The last command issue multiple sql command in separate branches, it seems to be is not efficient at all, is there a option to send all command in a single batch?
Thanks
Not unless you count combining them in a manual sql statement and doing a context.Database.ExecuteSqlCommand() (which I wouldn't)
See (true up to EF 5.0 beta 1 so far): http://msdn.microsoft.com/en-us/library/gg696165(v=vs.103).aspx
精彩评论