Thanks for your answer, but I'm not puting the "_ALIASORDER_" prefix in the associationPath parameter...
When I do this:
Code:
criteria.CreateAlias(itemOrder.Property.Substring(0, itemOrder.Property.IndexOf('.')), aliasForOrdering);
is the same as doing
Code:
criteria.CreateAlias("PostHighlight", "_ALIASORDER_PostHighlight");
(this emulates the above example:
Quote:
Code:
criteria.createAlias("terminalStatus", "ts");
)
And then I replace the name of the property with the new alias...
First I replace the name:
Code:
itemOrden.Property = aliasForOrdering + "." + itemOrder.Property.Substring(itemOrder.Property.IndexOf('.') + 1);
This is the same as doing
Code:
itemOrden.Property = "_ALIASORDER_PostHighlight.Price";
Second and last, I add the order criterion:
Code:
criteria.AddOrder(new NHibernate.Expression.Order(itemOrder.Property, true));
where of course itemOrder.Property 's value is "_ALIASORDER_PostHighlight.Price"
So, where's the error?