0
LINQ group by
은 NH 3.0 GA에서 아직 지원되지 않습니까? 내 LINQ는 다음과 같습니다NH 3.0 GA Linq Group 작동하지 않음
var q = from p in session.Query<Product>()
group p by p.Category into g
select new {
Category = g.Key,
TotalValue = g.Sum(p => p.UnitsInStock * p.Price)
};
마녀는 다음과 같은 SQL로 변환됩니다 category1_.Name는 GROUP BY 절에 없기 때문에
이 select category1_.Id as col_0_0_,
cast(sum(product0_.UnitsInStock*product0_.Price) as DOUBLE PRECISION) as col_1_0_,
category1_.Id as Id0_,
category1_.Name as Name0_
from [Product] product0_
left outer join [Category] category1_ on product0_.Category_id=category1_.Id
group by category1_.Id
이 SQLException을 생성합니다.
알려진 버그입니까? 해결 방법이 있습니까? 이 LINQ는 EF 4에서 잘 작동합니다.
감사합니다. 이것은 그룹별로 작동하지 않는 이유를 발견 한 첫 번째 정보입니다. –
나는 대답을 찾았습니다 : http://blog.patearl.net/2010/12/nhibernate-30-linq.html : NH3 Linq 아직 베타 버전에서 끝나지 않았습니다 ... –