Linq to entities order by over wcf
I'd like to expose a method over WCF something like GetEmployees(EmployeeColumn orderby), that returns a list of employees in an order.
I don't really want to create an enum EmployeeColumn that contains all possible column so the user开发者_开发技巧 can choose.
What do you suggest? I'd like to achieve this using linq-to-entities.
If you want to tell the service what to order by you need to send the column to sort on either as an enum or as a string. Both would require some logic on the server side.
Is there a reason why you need to do the sorting on the server side?
If not it is very easy to sort on the client side using linq to entities.
精彩评论