1
嗨,我想知道如何在LINQ中創建嵌套子查詢到實體。LINQ到實體嵌套子查詢
例如這是我想在linq中翻譯的我的sql子查詢。
SELECT
@planned = COUNT(ID)
FROM Task_Detail
WHERE task_id IN
(
SELECT
task_id
FROM Story_Task
WHERE is_testcase = 'true' AND
story_id IN
(
SELECT str_id FROM dbo.story
WHERE prjId = @pro_id AND
str_id IN
(
SELECT str_id FROM dbo.Sprint_StoryMapping WHERE sprint_id = @sprintid
) AND is_testcase = 'true'
)
) AND status = 1 AND
DATEPART(dd,workDate) = DATEPART(dd,@stdt)
模型中這些實體之間是否存在關係,還是這些完全無關的表? – mkedobbs 2009-11-17 20:51:09