Reputation: 8934
I developing a paged service to retrieve data from database using NHibernate. In my actual point I'm receiving a skip, take and string order parameter.
My question is, exist some native library to ordering in .NET, something that consider asc or desc ordering, maybe the list of field to order in priority.
e.g: Order Name Asc, City Desc.
So:
Paul | New York
Paul | Amsterdam
-- Edit
IEnumerable<Obj> actuals = _repository.LoadByName("Pa", p => p.Name);
And the method signature:
public IEnumerable<Obj> LoadByName<TKey> (string name, Func<Obj, TKey> ordering = null, int skip = 0, int take = 0) {
Upvotes: 0
Views: 81