A query:
Query.All().Select(c => new PipeAbonentDocumentReportItemDto() {
Year = (c.Date != ((Nullable<DateTime>)null))
? ((Nullable<Int32>)c.Date.Value.Year)
: null,
}).GroupBy(
g => new PipeAbonentDocumentReportItemDto() {
Year = g.Year
},
(e, g) => new PipeAbonentDocumentReportItemDto() {
Year = e.Year,
LineCount = g.Count()
}
)
Actual grouping is being made by '[c].[Date]' instead of 'CAST(DATEPART(YEAR ,
[b].[Date]) AS integer)'
P.S.
'Order by' clause is translated correctly.
Original issue reported on code.google.com by Dmitri.Maximov on 23 Sep 2010 at 11:47
Original issue reported on code.google.com by
Dmitri.Maximov
on 23 Sep 2010 at 11:47