【发布时间】:2010-10-03 14:53:45
【问题描述】:
Select 和 SelectMany 是否比 Joins 更可取?
我想知道的原因是因为我使用 LinqPad,并且在一个部分中有 cmets 说:
// 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 而不是 Joins。
【问题讨论】:
标签: .net sql linq linq-to-sql .net-3.5