I am using a repository pattern to wrap NHibernate entities. One of the methods is public IList<T> GetAll()
which simply returns all items of that entity. The implementation is done in either Criteria or QueryOver.
I would like to overload this method to accept a sorting order, something like this: public IList<T> GetAll(NHOrderFor<T> order)
which I could call and fluently define the order for. Is this possible? QueryOver is preferred but not required.
Update
I got a little further ahead. I defined the parameter as Expression<Func<T,object>> path
which is what's expected by QueryOver.OrderBy() but the expression is missing the .Asc or .Desc
specification that's required to follow.