我有以下 LINQ2SQL 查询:
From pc In DBContext.ProcessCodes
Join c In DBContext.Cells On pc.idCell Equals c.idCell
Where pc.idType = "Cars" AndAlso
pc.Active = True AndAlso
c.Active = True
Select c
出于某种原因,当我认为我应该获得内部连接时,我却获得了交叉连接(笛卡尔积)。如果我在 where 中进行多个 From 的键比较,我会得到同样的结果。
我做错了什么?
最佳答案
我认为这对你有帮助:
From pc In DBContext.ProcessCodes
From c In DBContext.Cells
Where pc.idType = "Cars" AndAlso
pc.Active = True AndAlso
c.Active = True
Select c
关于vb.net - linq2sql的交叉连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6182321/