我需要这个SQL查询转换为LINQ查询,我也需要公开SQL选择属性:转换这个SQL查询来LINQ查询
SELECT Problem.ProblemID, ProblemFactory.ObjectiveID, Objective.Name, ProblemFactory.Time, ProblemType.ProblemTypeName, ProblemFactory.OperationID,
ProblemFactory.Range1ID, ProblemFactory.Range2ID, ProblemFactory.Range3ID, ProblemFactory.Range4ID,
ProblemFactory.MissingNumber
FROM Problem INNER JOIN ProblemFactory ON Problem.ProblemFactoryID = ProblemFactory.ProblemFactoryID
INNER JOIN ProblemType ON ProblemFactory.ProblemTypeID = ProblemType.ProblemTypeID
INNER JOIN Objective ON Objective.ObjectiveID = ProblemFactory.ObjectiveID
更新1:
这是什么我有:
var query = from problem in dc.Problem2s
from factory
in dc.ProblemFactories
.Where(v => v.ProblemFactoryID == problem.ProblemFactoryID)
.DefaultIfEmpty()
from ...
而且我用这个例子:What is the syntax for an inner join in LINQ to SQL?
好的,那你的问题是什么?我们不会为你做你的工作... – cdhowie
我知道,虽然这只是一个疑问。我没有和LINQ一起工作得很好。我需要一点帮助。问题是我使用三个内部连接,我不知道如何在LINQ中转换它 – Darf
我更新了文章 – Darf