I would like to get this SQL from NHibernate:
SELECT SUM(color_pages) * SUM(total_pages) FROM connector_log_entry GROUP BY department_name
But I cannot find arithmetic operations (*) anywhere.
This is the code that I still have:
Session.QueryOver<ConnectorLogEntry>() .SelectList(list => list .SelectGroup(m => m.DepartmentName) .WithAlias(() => dto.Department) .Select(Projections.Sum<ConnectorLogEntry>(m => m.TotalPages)) //.Select(Projections.Sum<ConnectorLogEntry>(m => m.ColorPages)) .WithAlias(() => dto.TotalColorPercentage)) .TransformUsing(Transformers.AliasToBean<DepartmentConsumption>());
math c # nhibernate queryover
Andrej Slivko
source share