t_plusplus
t_plusplus

Reputation: 4209

Linq Nested Query with Left Join and Inner Joins

Hi I have this query in SQL which I would like to convert to Linq (Entities), I am a beginner in this and I wonder how to:

        select k.ID from dbo.Cases k
        left join 
            (
                select c.ID, r.RelatedCaseID from dbo.Cases c 
                    inner join
                        (
                            select r.RelatedCaseID, r.CaseID from   dbo.RelatedCases r where r.CaseID = 368
                        ) r
                    on c.ID = r.RelatedCaseID
            ) c
        on k.ID = c.ID

        where k.ID <> 368 and c.RelatedCaseID is null 

I would like to return this a function of return type of: IEnumerable object.

Thank you.

Upvotes: 1

Views: 574

Answers (0)

Related Questions