Entity Framework has an associated Repository that provides built in functions for standard operations. One of these functions is a generalized Get(filter, orderby, includeList) method. I know how to use the filter and includeList, but I’ve not figured out how to use the orderby parameter. The orderby parameter is given as:
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null
and the evaluation is:
IQueryable<TEntity> query = DbSet;
if (orderBy != null) {
return orderBy(query).ToList();
} else {
return query.ToList();
}
Any hints or examples will get me started
Thanks.
Maybe like so: