How to made Paging base on SortedList class
-
09-07-2021 - |
문제
Hello i have method returned SortedList object I need to do Paging
SortedList output = this.GetSearchResults(SearchQuery.QueryString, se);
ViewBag.ResultSearch = output;
How to make equivalent example in linq
....Skip(100).Take(5);
Thanks
해결책
Since a SortedList
does not implement IEnumerable<T>
(unlike SortedList<TKey,TValue>
) you need to cast it to a type to get an IEnumerable<T>
.
For example:
var paged = sl.Cast<Object>()
.Skip(100)
.Take(5);
제휴하지 않습니다 StackOverflow