I have this basic table structure:
Messages
Postxtags
Posttags
There is a 1-n relationship between posts, PostXTags and between PostTags, PostXTags
I need to get all posts with their tags.
PostTags has a type field, and I want a filter on it. Each condition also encounters this error:
The Include path expression must specify the navigation property defined in the type. Use dashed paths for referenced navigation properties and the Select statement for navigation properties for the collection. Parameter Name: Path
Public IQueryable<Post> GetPosts() { return from p in _db.Posts select p; } var posts = GetPosts().Include(p => p.PostXTags.Select(pxt => pxt.PostTag).Where(pt=>pt.Type == 2)).ToList();
source share