The syntax is as follows and let me know if you are having trouble translating the code. Generic Outer Join:
var query = from l in left
join r in right
on l.ID
equals l.right.ID into groupedJoin
select new
{
ID= l.ID,
OuterJoined= groupedJoin.Select(r=> right)
};
Your result is everything in the left, even if the right does not exist.
Obviously, I cannot guarantee that it will compile, but it will look like this:
var surgeonList = (
from item in context.T1_STM_Surgeon
.Include("T1_STM_SurgeonTitle")
.Include("OTER")
where item.ID == surgeonId
join reptable in context.OSLP
on item.Rep equals reptable.SlpCode into groupedJoin
select new
{
ID = item.ID,
First = item.First,
Last = item.Last,
Rep = reptable.SlpName,
Reg = item.OTER.descript,
PrimClinic = item.T1_STM_ClinicalCenter.Name,
Titles = item.T1_STM_SurgeonTitle,
Phone = item.Phone,
Email = item.Email,
Address1 = item.Address1,
Address2 = item.Address2,
City = item.City,
State = item.State,
Zip = item.Zip,
Comments = item.Comments,
Active = item.Active,
DateEntered = item.DateEntered
OSLP = groupedJoin.Select(x=>WHATEVERYOUNEED)
}).ToList();
groupedJoin.Select(x = > WHATEVERYOUNEED) -, .ToList