1) the approach is to define a query that results in a sequence of items
2) you will then process the sequence of items (e.g. create the collection of these items instead of adding them individually)
3) each
foreach...if
translates into
from... where... select
(or
myCollection.Where(...)
)
4) nested foreach is either chained or you use
SelectMany()
Search google for an example on
SelectMany
.
[EDIT]
E.g.
...
var query = salesCustomer.SalesLineOfBusinessCollection
.Where(lob=>lob.LineOfBusinessCode == purchasePlanRequest.LOBCode)
.SelectMany(lob=>lob.SalesPlanCollection)
.Where(salepln=>salepln.IsCurrentPlan);
var currentPlan = new Collection<SalesPlan>(query);
...
[/EDIT]
Cheers
Andi