I am working on a query in NHibernate in which user could provide a sorting order for some selected fields. I need to do a OrderBy()
in QueryOver with the names of field names in entities, but when using projection list I am getting like this.
SELECT
this_.Number as y0_,
scc3_.Code as y1_,
FROM sometable
WHERE 1=1 ORDER BY this_.Number as y0_,
scc3_.Code as y1_ asc
The projection list for select columns is different from orderby projection list and I am not using .WithAlias()
sortProjectionList.Add(Projections.Property(() => stock.Number));
sortProjectionList.Add(Projections.Property(() => scc.Code));
How can I create a projectionlist without aliases or aliases with custom names?
Thanks