开发者

can entity framework combine sql command in a batch

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜