Linq to SQL 和 Intersect
各位,
我需要在 LINQ to SQL 查询上使用 Intersect。但是,我得到一个例外,基本上表明我不能。
代码编译得很好,但 LINQ to SQL 会生气。
有没有办法用 LINQ to SQL 复制 Intersect?
提前致谢。
Folks,
I need to use Intersect on a LINQ to SQL query. However, I get an exception basically stating that I can't.
The code compiles fine, but LINQ to SQL gets angry.
Is there any way to replicate Intersect with LINQ to SQL?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是如何执行此操作的示例:
Here is an example of how to do this:
不允许
var example = memoryObject.Union(sqlObject)
但你可以做
var example = sqlOjbect.Union(memoryObject)
如果 sqlObject 和 memoryObject 属于同一类型。var example = memoryObject.Union(sqlObject)
is not allowedbut you can do
var example = sqlOjbect.Union(memoryObject)
if both sqlObject and memoryObject are of the same type.