I'm trying to return a record set that includes child records that meet a specific data requirements. This is my base query, and in this case I am only trying to bring back children where the IsActive field is true.
var result = db.Projects
.Include(p => p.Department)
.Include(p => p.ProjectPhases.Where(pp =>pp.IsActive ))
.Include(p => p.Notes)
.AsQueryable<Project>();
This returns 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.
Is there simple way to do this?