There's a problem in the LINQ provider when translating the grouping
Key property to SQL.
Example:
my simplified entity:
public class Simple
{
public string Division {get;set;}
public decimal Amount {get;set;}
}
....
var actual=from div in session.Query<Simple>()
select div;
var
result=actual.GroupBy(i=>i.Division).OrderBy(g=>g.Key).Select(g=>new
{ Division=g.Max(i=>i.Division),TotalAmount=g.Sum(i=>i.Amount)});
This results in
base {NHibernate.HibernateException} = {"could not resolve property:
Key of: DomainModel.Entities.Simple
[.Select(.OrderBy(.GroupBy(.Where(.Select(NHibernate.Linq.NhQueryable`1[DomainModel.Entities.Simple],
Quote((detail, ) => (detail)), ), Quote((item, ...
This is causing us a large problem that we cannot control using third
party rapid development UI controls that use LinqServerModeDataSource,
which work with any LINQ provider. It allows passing an IQueryable to
a proprietary grid's data source, which allows to transfer any sorting/
grouping/filtering/paging expressions made in the grid directly to the
data source. Everything works with NHIbernate LINQ provider, but the
grouping, due to missing translation support for .Key grouping
property.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.