I have a LINQ to Entities statement that joins two models on an AlphaGroupID, like this:
IEnumerable<ICD.ViewModels.HomeSearchViewModel> ICDList = (from a in ICDUnitOfWork.AlphaGroups.Find()
join e in ICDUnitOfWork.Alphas.Find()
on a.AlphaGroupID equals e.AlphaGroupID)
I need to join the two tables on AlphaGroupID, but I also need all of the ICDUnitOfWork.AlphaGroups regardless of whether or not they have a corresponding AlphaGroupID in ICDList. How can I accomplish this?
Use
join into(it is same as GroupJoin):GroupJoin produces hierarchical result – for each item in outer sequence will be generated sequence of corresponding items in inner sequence (sequence could be empty).