Error 4 Cannot implicitly convert type
'System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<CCE_2009.Data.Person>>'
to
'System.Collections.Generic.IEnumerable<CCE_2009.Data.Person>'
Generated from:
var RecoveryManagerQuery =
from RM in
(
from REP in e.Results
select REP.Organization.Representatives.Select(RM=>RM.Person)
)
select RM;
RecoveryManagers = new ObservableCollection<Person>(RecoveryManagerQuery.ToList());
Why is this IEnumberable embeded – Organizations have one or more representatives where each representative is related to one and only one person.
I want a list of Persons that match this criteria…..
argghh..
R
The outer query is redundant. We can make this clearer by removing it:
As you can see, the
selectclause says, for eachREP, to select all the people associated with representatives inREP‘s organization. This means that each element inRecoveryManagerQueryis going to be a set ofPersonobjects, not an individual object. You want to flatten the query so it returns a set ofPersonobjects, not a set of a set ofPersonobjects:Edit: Here is the dot notation: