An AggregatingGroupJoin is a query such as:
from c in db.Customers
join o in db.Orders on c.CustomerId equals o.Customer.CustomerId into ords
join e in db.Employees on c.Address.City equals e.Address.City into emps
select new { c.ContactName, ords = ords.Count(), emps = emps.Count() };
where the results of the joins are being fully aggregated and hence do not create any form of hierarchy.
This class takes such expressions and turns them into this form:
from c in db.Customers
select new
{
c.ContactName,
ords = (from o2 in db.Orders where o2.Customer.CustomerId == c.CustomerId select o2).Count(),
emps = (from e2 in db.Employees where e2.Address.City == c.Address.City select e2).Count()
};
Namespace: NHibernate.Linq.GroupJoinAssembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)
Syntax
C# |
---|
public class AggregatingGroupJoinRewriter |
Visual Basic |
---|
Public Class AggregatingGroupJoinRewriter |
Visual C++ |
---|
public ref class AggregatingGroupJoinRewriter |
Inheritance Hierarchy
See Also