1

我正在尝试按SortedDictionary..中的值对项目进行排序

我已经做到了,mySortedDictionary.OrderByDescending(key => key.Value);它返回排序的键值对..

但以同样的方式,我OrderByDescending在 ASP.NET 网页中使用方法,但是说

System.Collections.Generic.SortedDictionary' 不包含 'OrderByDescending' 的定义,并且找不到接受类型为 'System.Collections.Generic.SortedDictionary' 的第一个参数的扩展方法 'OrderByDescending'(您是否缺少 using 指令或装配参考?)

我怎样才能在我的网页中实现这个操作?

任何替代技术???

提前致谢..

4

1 回答 1

6

OrderByDescendingSystem.Linq.

确保您在班级顶部有相关的 using statemenet

using System.Linq;

于 2013-04-13T21:55:58.687 回答