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"

Was it helpful?

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
scroll top