I am using Visual Studio 2008. I am trying add multiple columns inside a single GroupProperty method of Nhibernate.Projections Class. But But I am failing to get the required output. I tried something like this.
ICriteria Criteria = CreateCriteria("BaseCriteria");
projectionList.Add(Projections.GroupProperty(
Projections.SqlFunction("concat",
NHibernateUtil.String, Projections.Property("FirstName"),
Projections.Constant(' '),
Projections.Conditional(Expression.IsNotNull("LastName"),
Projections.Property("LastName"), Projections.Constant(String.Empty)))), "ClientName");
Generally, aside with
RowCount,SumandGroupPropertywe can useSqlGroupProjectionThe alias "ClientName" is repeated few times as an alias .. not sure which could be omitted, so prefer to use them all
And as shown here NHibernate GroupBy and Sum
That could be easily transformed into
with