我有以下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与密钥比较,我会得到同样的东西。
我做错了什么?
答案 0 :(得分:0)
我认为这有助于你:
From pc In DBContext.ProcessCodes
From c In DBContext.Cells
Where pc.idType = "Cars" AndAlso
pc.Active = True AndAlso
c.Active = True
Select c