I’ve got the following ADO.NET Entity Framework Entity Data Model:

I want to find all the Policyholders with both a Service of a given Id and also a Keyword of a given Status.
This LINQ Does Not Work:
Dim ServicesId As Integer = ... Dim KeywordStatus As Integer = ... Dim FoundPolicyholders = From p As Policyholder In db.PolicyholderSet.Include('Keywords').Include('Services') _ Where p.Services.Id = ServicesId _ And p.Keywords.Status = KeywordStatus _ Select p
The Where clause cannot search the p.Services and p.Keywords EntityCollections in that way.
‘Id’ is not a member of ‘System.Data.Objects.DataClasses.EntityCollection(Of ….Service)’.
What is the correct LINQ syntax to do what I want?
Why does your query not work? Because
p.Servicesandp.Keywordsare aServiceand aKeywordcollection – they have not propertyIdorStatushence you cannot usep.Services.Idorp.Keywords.Status.Visual Basic…