日期:2014-05-20  浏览次数:20729 次

How can I implement the dynamic orderby in linq to entity
Just my qestion

------解决方案--------------------
Hi lnq,

I think you can try this:
http://www.cnblogs.com/Magicworks/archive/2011/04/10/2011725.html

------解决方案--------------------
探讨
what is "dynamic orderby" you said?

a simple way is extract a Predicate<Entity> param:


C# code
IList<T> OrderBy(IList<T> set, Predicate<T> orderby)
{
return set.OrderBy(x => orderby(x))……