I'm running LLBLGen Pro v3.1 released 02/24/2012.
And I realize that the query makes no sense. All I'm trying to do is point out the fact that introducing "p.Department.*" into the Where causes it to work incorrectly.
My real situation is much more complicated but boils down to this in the end. I need to retrieve a collection of entities (let's call them C) filtered by whether or not their parent (B) has the largest X value among all other Bs that belong to B's parent (A) that share the value of a particular property (Y) in common. So I'm doing something like:
metaData.C.Where(c => c.B.X == c.B.A.Bs.Where(b => b.Y == c.B.Y).Max(b => b.X))
// does not work
Although, the following works fine for retrieving a collection of Bs by the same logic:
metaData.B.Where(b => b.X == b.A.Bs.Where(bb => bb.Y == b.Y).Max(bb => bb.X))
// works
I'm not sure why placing the exact same code a level deeper is causing this to fail