I'm trying to make a repository class that has a method to order the results based upon a "sort" parameter. I need to pass it as a parameter since I'm trying to be very strict that my repository doesn't return IQueryable and only returns List. The problem is that I have no idea how to make it so that it meets the following requirements:
- Allow for multiple columns.
- Strongly typed to the entity that's returned (no strings for columns as parameters).
- Ability to set a specific column as descending.
Is this even possible or is it useless that a Repository allows returning with ordering? Should the repository be just able to perform CRUD operations? Maybe returning IQueryable would be the best option?