How to convert an NHibernate.Expression.Order object into a string?
-
14-09-2020 - |
Question
I have a list of NHibernate.Expression.Order objects and want to convert them into a sql string.
i.e. "Name ASC, Id DESC, Amount ASC"
Solution
List<string> sqlSortingList = new List<string>();
if (OrderList != null)
{
foreach (Order order in OrderList)
{
sqlSortingList.Add(order.ToString());
}
}
Later I will concatenate the strings into one string.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow