1)
context.connection.open()
var albums = (from a in context.Albums
where a.id == id
select a);
context.connection.close()
2)
context.connection.open()
var albums = (from a in context.Albums
select a);
context.connection.close()
var result = albums.where((a)=>{a.id == id});
之间的不同会用第一个
更快它是
谢谢你的所有答案..嗯..我有点困惑与数据逻辑层。这是否意味着我们已经在vs.net中生成的数据上下文已经代表了数据逻辑层... – LittleFunny 2009-11-05 09:12:37