LINQ 查询返回在联接中没有关联记录的记录列表
返回结果集是没有关联记录的记录的查询的最有效方法是什么?我正在使用 LINQ 和 Visual Basic,并一直尝试构造一个左外连接,然后筛选关联表中 id 为空或为 null 的记录,但对此我很陌生,无法进行任何操作。
想要做类似的事情:
Dim query = From s In db.spaces _
Group Join t In db.tickets On s.spaceid Equals t.spaceid Into rs = Group _
Select rs
End Function
我想返回整个左表减去这个结果集,但我是一个真正的菜鸟并且被卡住了。
What is the most efficient way to return a query where the result set is those records that do NOT have an associated record? I am using LINQ and Visual Basic and have been trying to construct a left outer join and then filter on those records whose id is nothing or null in the associated table but am so new to this that I can't get anything to work.
Want to do something like:
Dim query = From s In db.spaces _
Group Join t In db.tickets On s.spaceid Equals t.spaceid Into rs = Group _
Select rs
End Function
I want to return the entire left table minus this result set but am a real noob and am stuck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我的头顶上下来,希望它是对的!
Off the top of my head, hope its right!!