How to efficiently handle Where and OrderBy clauses
- by Goran
My business layer passes all the required information to UI layer. From what I have read, in general, best practice is to send fetched data to UI layer, and to avoid passing queries like ObjectQuery. My problem with this approach is next:
If I am to make a flexible business layer, then I should allow UI to sort the data anyway it requires. Fetching sorted data from database, and then resorting them in UI is kind of bad practice for me, so the only way is to somehow
So what are my options? Is there a way to make it like this:
public void OrderByMethod(params ...) { .... }
so I can call it like this:
OrderByMethod(MyEntity.Property1, MyEntity.Property2 descending....);
Thanks,
Goran