Situation:
I have some persons with certain skills and they can/might belong to more than one area. The skills are linked in a seperate table, so are the areas.
I get the people list from selecting all persons with a match on each skill and add them to a list where I can use Distinct() to make sure that they dont show up twice.
Resulting list of the persons:
List<Person> peopleWithRightSkills
On each [Person] object I have at least 1 address linked, but they can have more as its in a relation to [Person]
I have another list:
List<PostalCode> acceptedPostalcodes
Now I need to compare and filter those peopleWithRightSkills who have an address where the postal code of the address is within the acceptedPostalcodes
I have been investigating the Lambda expressions, the SelectMany among other solutions, but right now, I have only one option which I believe is the "old style" of doing things, namely to run through each Person and for each person match her/his address list against the list of postalcodes. and for each match then add this to the:
List<Person> matchedPeople
Table overview (shortend down the needed details)
[Table:Person]
int:ID (primary)
string:FirstName
string:LastName
[Table:Address]
int:Person_ID (foreign key to Person)
int:PostalCode_ID (foreing key to PostalCode)
string:StreetName
[Table:PostalCode]
int:ID
string:CityName
As I see the problem, its just a "short list pr. person"(minimum 1, perhaps up to 10 addresses) and I need to compare this address list against a "valid postalcode list" for each person.
In hope of a great answer to this, as I've been stuck for some hours now, trying to figure out what syntax to use to solve this more beautiefull and less performance hard.