In the LINQ query below, I want to return the ContractorId found in the Contractors table. Not all people in the Contacts table are in the Contractors table. What I really want is a list of ContractorIds for those contractors that meet the criteria. ContractorId is not the same as ContactId.
var contractorsWithCertsFor2010 = dc.Contacts.Where(x => x.Contractors
.Any(d => d.ContractorStatus
.Any(date => date.StatusDate.Year >= 2010)))
.Select(x => x.Contractors
.Select(dr => dr.ContractorId));
IEnumerable<int> differenceQuery = allPeople.Except(contractorsWithCertsFor2010);
allPeople is IQueryable<Int>, but contractors WithithCertsFor2010 is IQueryable<IEnumerable<Int>>.Something is wrong there. Multiple .Select () calls IQueryable<IEnumerable<Int>>, so I'm looking for a way to eliminate one of .Select () and get a return
IQueryable<Int>
Any suggestions? Thank!
:
. , . "" "", .Select().