var query = (from pn in PriorNavPositions
join sa in SourceDataset.SourceInvestorAllocations on
new { SourceDatasetId = pn.SourceDatasetId, Iqid = pn.SubscriberFiid, ShareIndex = pn.ShareIndex } equals
new { SourceDatasetId = sa.SourceDataset.Id, Iqid = sa.IqId, ShareIndex = sa.EFrontInteger }
join ea in EfrontNavDataset.EfrontNavInvestorAllocations on
new { SourceDatasetId = sa.SourceDataset.Id, Iqid = sa.IqId, ShareIndex = sa.EFrontInteger } equals
new { SourceDatasetId = ea.EfrontNavDataset.SourceDatasetId, Iqid = ea.IqId, ShareIndex = ea.ShareIndex } into pnj
from ea in pnj.DefaultIfEmpty()
select new { sa, ea, pn }
I am looking for left join in this EF query to get all the records from table PriorNavPositions.
Use group join (e.g.:
join _ in _ on _ equals _ into _) and then callDefaultIfEmptyon the result of the group join:https://learn.microsoft.com/en-us/dotnet/csharp/linq/standard-query-operators/join-operations#perform-left-outer-joins