转换 System.Collections.Generic.SortedList;进入 IEnumerable

发布于 2024-12-21 08:07:02 字数 264 浏览 1 评论 0原文

最有效方法是什么

System.Collections.Generic.SortedList<string,Contact>

将 a 转换为 a 的

IEnumerable<Contact>

IEnumerable 的使用者是一个 MVC 视图,它希望按照 System.Collections.Generic.SortedList 中存储的顺序显示项目

What is the most efficient way to convert a

System.Collections.Generic.SortedList<string,Contact>

into a

IEnumerable<Contact>

The consumer of IEnumerable is an MVC view which will want to display the items in the order in which they were stored in System.Collections.Generic.SortedList

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千纸鹤带着心事 2024-12-28 08:07:03

SortedList.ValuesSortedList.GetValueList (仅在非通用版本中)正是您所需要的。

SortedList.Values or SortedList.GetValueList (only in the non-generic version) is just what you need.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文