开发者

can entity framework combine sql command in a batch

开发者 https://www.devze.com 2022-12-23 15:12 出处:网络
I write 开发者_如何学Cthe following code with entity framework context.AddObject(obj1); context.AddObject(obj2);

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

0

精彩评论

暂无评论...
验证码 换一张
取 消