score:2

Accepted answer

try below code

            var summarypayments = (from s in paymentslist
                               join alloc in allocationlist on s.id equals alloc.originalid into allocorg
                               from po in allocorg.defaultifempty()
                               join allocrev in allocationlist on s.id equals allocrev.reversalid into allocrevs
                               from pr in allocrevs.defaultifempty()
                               select new { s, pr }).select(x => { x.s.reversalid = (x.pr != null ? x.pr.reversalid : 0); return x.s; });

Related Query

More Query from same tag