降序排序不适用于LINQ to Entity 在下面的查询代替升序如果我继续下降它不起作用。请帮帮我
var hosters =
from e in context.Hosters_HostingProviderDetail
where e.ActiveStatusID == pendingStateId
orderby e.HostingProviderName ascending
select e;
return hosters.ToList();
答案 0 :(得分:4)
答案 1 :(得分:4)
您还可以使用lambda表达式来获得相同的结果:
return context.Hosters_HostingProviderDetail.Where(e => e.ActiveStatusID == pendingStateID).OrderByDescending(e => e.HostingProviderName).ToList();