tags:

views:

80

answers:

1

Im using linq-sql .I have 3 tables. e.g

Project, People and a ProjectsPeople(fk's ProjectID and PeopleID) (junction) Table.

given a set of peopleIDArray (an array of ints as people ID's)

how can i get only Projects that have atleast one of the peopleId's associated with them?

i.e there will be atleast one (may be more) record in the ProjectsPeople table that will have a ProjectId and an id from the peopleIDArray )

thanks

A: 
var q = from pr in db.Projects
        where pr.ProjectsPeople.Any(pp=>peopleIDArray.Contains(pp.PeopleID)
        select pr;
James Curran