Duplicate
Details
Details
Assignee
Unassigned
UnassignedReporter
Tuna Toksoz
Tuna ToksozComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created July 4, 2008 at 1:06 PM
Updated April 1, 2013 at 7:01 PM
Resolved October 5, 2008 at 6:19 AM
This functionality is needed in order to support many scenarios in NHibernate.Linq. This feature is directly related with Subquery Projection.
One example use can be:
rootCriteria.SetProjection(Projections.ProjectionList()
.Add(Projections.Entity("c"))
.Add(Projections.Alias(Projections.SubQuery(visitor.Criteria), "orderby"));
One concrete example of where this is necessary is the following linq query:
from c in customer
orderby c.Orders.Count
select c;
which should roughly translate to the following SQL query:
select
c.*,
(select count from Orders e where e.CustomerID = c.CustomerID) orderby
from Customers c
order by orderby
Priority set to major in order to support nhibernate features