是什么使得 Select、Join、Where 等方法成为 Linq-to-Object 的标准查询运算符而不是......?
1)在内部,是什么使得诸如 Select
、Join
、Where
等方法(除了查询表达式被编译器翻译成这些方法调用)是 Linq-to-Object 的标准查询运算符,而不仅仅是碰巧对数据序列进行操作的常规方法?
也就是说,这些运算符提供的所有功能也可以在常规方法中实现,但我们不将这些常规方法称为标准查询运算符?!
2) Linq-to-XML 方法也有同样的问题 - 那么,是什么让它们查询运算符而不仅仅是操作 XML 数据的常规方法?
谢谢
1) Internally, what is it that makes methods such Select
, Join
, Where
etc ( besides the fact that query expressions get translated by compiler into these method calls ) a Linq-to-Object's standard query operators and not just regular methods that happen to operate on sequences of data?
Namelly, all the functionality offered by those operators could also be implemented in regular methods, but we don't call those regular methods standard query operators?!
2) Same question for Linq-to-XML methods – thus, what makes them query operators and not just regular methods that operate on XML data?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们是“只是常规(以及扩展)方法”,但它们也在 LINQ 标准查询运算符 页面:
一个有趣的问题是
Zip
是否应该计数作为标准查询运算符,因为它是在 .NET 4 中引入的...Well they are "just regular (well, extension) methods" but they're also defined in the LINQ Standard Query Operators page on MSDN:
One interesting question is whether
Zip
should count as a standard query operator, given that it was introduced in .NET 4...