1
我嘗試我的SQL代碼轉換爲LINQ,但我不能:如何將我的Sql代碼轉換爲Linq?
Alter PROCEDURE sp_MatchCTallyToTask
AS
BEGIN
select * from Task where MPDReference in( select MPDReference from Task
intersect
select ENG_CUSTOMERTALLY_CUSTOMERTASKNUMBER from dbo.ENG_CUSTOMERTALLY)
END
GO
public List<Task> TaskList()
{
return engCtx.Tasks.Where(t => t.MPDReference.Contains(engCtx.ENG_CUSTOMERTALLies.Select(c => c.ENG_CUSTOMERTALLY_CUSTOMERTASKNUMBER).
Except(engCtx.Tasks.Select(tsk => tsk.MPDReference).AsQueryable())).ToList());
}