Linq to Entities Only Select with Records

Nghich.ORG

New Member
I am trying to only select donors that have applicable donorsToActions items in the following Linq To Entities:\[code\]donors.SelectMany(Function(t) t.donorstoactions).GroupBy(Function(s) s.donor.id).[Select](function(p) New With { _Key .donorname = p.key, _Key .donoractions = p.Where(Function(j) j.action.event.id = "1").[Select](Function(k) New With { _ Key .actionname = k.action.name, _ Key .pledge = k.pledgeAmount, _ Key .part = k.participant.name }) _})\[/code\]Currently, this pulls:Donor1(), Donor2(group of donor actions), Donor3(), Donor4(), Donor5(group of donor actions)...I would like it to not pull the donors that have no donoractions attached: Donor2(group of donor actions), Donor5(group of donor actions)Can someone please point me in the right direction?Thanks
 
Back
Top