I'm trying to query Users including each user's Interests, but only where an Interest meets certain criteria:
return db.Users.Include(u => u.Interests.Where(s => s.TenantId == tenantId))
But I get an error:
The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation properties.
I played with the idea of pushing the .Where outside, but haven't been able to get it working.
See Question&Answers more detail:os