15
Select和SelectMany更喜歡加入嗎?LinqToSQL Select and SelectMany與加入
我不知道的原因是因爲我使用LinqPad並在一節有評論認爲說:
// Note: before delving into this section, make sure you've read the preceding two
// sections: Select and SelectMany. The Join operators are actually unnecessary
// in LINQ to SQL, and the equivalent of SQL inner and outer joins is most easily
// achieved in LINQ to SQL using Select/SelectMany and subqueries!
然而,在其他部分也清楚地表明,連接速度更快(至少爲例子在LinqPad中給出)和對我來說,他們更容易在我的腦海中形象化。
也許我誤解了,因爲我只查看代碼示例而不是書,但是我看到其他人推薦Select和SelectMany over Joins。
謝謝,很好的回覆和鏈接。從非答覆的角度來看,我認爲應該使用哪一個並沒有太大的差別。 – dtc 2009-02-12 23:56:06