Outer join on multiple keys
-
Ok, I tried converting the following query into a LINQ outerjoin query select b.sProgID,a.sProgName1, a.nProgCode, b.bCurrentPrgrm from ABA.dbo.ResidentProgram as b left join ABA.dbo.Program A on A.sProgID=B.sProgID and A.nProgCode=B.nProgCode where b.nSSN = ? and bCurrentPrgrm = -1 and a.sProgID = b.sProgID I got upto the following before I had to post in here.. var q = from c in _DbAba.ResidentPrograms join o in _DbAba.Programs on c.sProgID equals o.sProgID into ps from p in ps.DefaultIfEmpty() select new { What I cannot figure out is how to translate the "A.sProgID=B.sProgID and A.nProgCode=B.nProgCode" into LINQ....Any help or advice would be greatly appreciated.
-
Ok, I tried converting the following query into a LINQ outerjoin query select b.sProgID,a.sProgName1, a.nProgCode, b.bCurrentPrgrm from ABA.dbo.ResidentProgram as b left join ABA.dbo.Program A on A.sProgID=B.sProgID and A.nProgCode=B.nProgCode where b.nSSN = ? and bCurrentPrgrm = -1 and a.sProgID = b.sProgID I got upto the following before I had to post in here.. var q = from c in _DbAba.ResidentPrograms join o in _DbAba.Programs on c.sProgID equals o.sProgID into ps from p in ps.DefaultIfEmpty() select new { What I cannot figure out is how to translate the "A.sProgID=B.sProgID and A.nProgCode=B.nProgCode" into LINQ....Any help or advice would be greatly appreciated.