开发者

Linq to entities order by over wcf

开发者 https://www.devze.com 2022-12-13 12:29 出处:网络
I\'d like to expose a method over WCF something like GetEmployees(EmployeeColumn orderby), that returns a list of employees in an order.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消