I am getting problem while working with positional parameters in Nhbernate.
Criteria GroupProperty is emitting sql with both named and positional variables.
This
It looks like a bug in NHibernate, but if you just want those results you can get the same result by using Projections.Distinct instead of Projections.GroupProperty, ie:
session.CreateCriteria(typeof(MatchStageFrom))
.SetProjection(Projections.Distinct(
Projections.SqlFunction("substring", NHibernateUtil.String,
Projections.Property("LastName"),
Projections.Constant(0),
Projections.Constant(1))
)
);
Alternatively if you're selecting more than just the first char of the name, then you could probably get it to work using a subselect