I have 4 entities.
- Organisation - a company that delivers training
- TrainingComponent - a training course
- Scope - a mapping between organisation & training component
- OrganisationSearchResult - another entity - links to Organisation.
I create a LINQ query that selects all Organisations that have a scope record to deliver a specific piece of training based on the name of the training course. I can verify that the list returned by this LINQ expression is correct.
I now use a IN type construct
session.Query<OrganisationSearchResult>() (r=> otherQuery.Contains(r.Organisation))
when this query executes the filter is not applied..