Код: Выделить всё
public static IEnumerable Paginate(IEnumerable records, int count, int page,
out int? nextPage, out int? previousPage, out int from, out int to, bool canScroll = true)
{
nextPage = null;
previousPage = null;
if (!canScroll)
{
from = 1;
to = count;
return records.Take(count);
}
if (page > 0)
{
previousPage = page - 1;
}
if (records.Count() > (page + 1) * count)
{
nextPage = page + 1;
}
var listed = records.Skip(count * page).Take(count);
from = count * page + 1;
to = count * page + listed.Count();
return listed;
}
< /code>
recordsЭтот метод занимает 10+ (!) Секунды при обработке с 500 строками. Как я могу это сделать?
Подробнее здесь: https://stackoverflow.com/questions/794 ... od-so-slow
Мобильная версия