Fixed
Details
Details
Assignee
Richard Brown
Richard BrownReporter
Graeme Foster
Graeme FosterComponents
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created April 20, 2011 at 11:36 PM
Updated July 30, 2011 at 2:11 PM
Resolved June 4, 2011 at 12:19 PM
If you QueryOver an entity, alias-join to a property on that entity which has an inheritance tree, and then attempt to project a property on a specific subclass of the entity, the property path loses the context of the alias and attempts to find it on the queryover root.
Pseudo code:
QueryOver<Customer>()
.JoinAlias(c => c.Order, () => orderAlias)
.SelectList(list => list.Select( () => ((SpecialOrder)orderAlias).SpecialReason);
blows up.
The equivalent in linq-nhibernate works OK which is why I think this is a bug.
Query<Customer>().Select( c => new { SpecialReason = ((SpecialOrder)c.Order).SpecialReason } );
Will attach issue zip in same format as NH Trunk issues.
Graeme