Link to home
Start Free TrialLog in
Avatar of Silas2
Silas2

asked on

SelectMany - Simple Linq Question

I have two lists List<Sales> and List<CashReceived>, the List<CashReceived> has zero-many records for every item in <Sales> (its internet sales, not all payments go thru, sometimes there are multiple attempts hence zero-many). I want a Select which will bring back all the Sales and all of their related CashReceived (or maybe zero ) grouped so I can analyse each group.
Is SelectMany right? I can't see how to make the join outer.
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Silas2
Silas2

ASKER

Right, is it possible to return a collection/list of the many side, i.e. for each item in SalesList have a nested List<CashReceived>?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Silas2

ASKER

Thanks, that did the trick.
Hi Silas2;

You can actually close the question yourself, see help link https://www.experts-exchange.com/help.jsp#hs=29&hi=407 , Select the option "Accept multiple solutions".

Have a great day.
Fernando