I have an IEnumerable
for multiple sort order specification where:
public class Specification
{
public string Column { get; set; }
public OrderByDirection Direction { get; set; }
public int Priority { get; set; }
}
Then I have another IQueryable
that I would like to lazy sort on the basis of the given IEnumerable respecting the direction and the priority. What would be the best approach to do this? are there any libraries out there that currently do this? Can someone explain how something like this can be approached with dynamic queries (expression trees)?
Note: Assume the column specified do exist in the IQueryable
.