CREATE TABLE PersonTask
(
PersonId INT NOT NULL,
WeekId INT NOT NULL,
WeekDaysTaskId INT,
WeekEndTaskId INT
)
GO
CREATE TABLE Task
(
Id INT PRIMARY KEY,
[Description] VARCHAR(250) NOT NULL
)
GO
INSERT INTO Task(Id, [Description]) VALUES(1, 'Task-01')
INSERT INTO Task(Id, [Description]) VALUES(2, 'Task-02')
INSERT INTO Task(Id, [Description]) VALUES(3, 'Task-03')
GO
INSERT INTO PersonTask(PersonId, WeekId, WeekDaysTaskId, WeekEndTaskId) VALUES(1, 1, NULL, 1)
INSERT INTO PersonTask(PersonId, WeekId, WeekDaysTaskId, WeekEndTaskId) VALUES(1, 2, 2, NULL)
INSERT INTO PersonTask(PersonId, WeekId, WeekDaysTaskId, WeekEndTaskId) VALUES(1, 3, 3, 3)
GO
SELECT
PT.PersonId,
WeekId,
'Not on Bench' as [Status]
FROM PersonTask AS PT
INNER JOIN Task AS T ON T.Id IN (PT.WeekDaysTaskId, PT.WeekEndTaskId)
WHERE WeekId = 3/*Param-1*/ and PersonId = 1/*Param-2*/
上記のT-sqlステートメントと同等のlinqクエリを作成しようとしていますが、無駄です。誰かが上記のT-SQLステートメントを取得するためにC#Linqクエリを手伝ってくれませんか。