Linq to Entities - left Outer Join
- by user255234
Could you please help me to figure this one out?
I need to replace a join with OSLP table with OUTER join. Seems a bit tricky for someone who is not an expert in Linq to entities. How would I do that?
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
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
}).ToList();
Thanks in advance!!