其他分享
首页 > 其他分享> > 白条扫码秒到二维码

白条扫码秒到二维码

作者:互联网

花呗、白条\/信客服:[3 3 1 5 7 5 6 4 4],分期乐提现,xin用卡秒提,、来分期、安逸花、任性付各种额度提现,花呗、白条\/信客服:[3 3 1 5 7 5 6 4 4]专业迅速秒回款,可当面操作,可远程操作!流程简单回款迅速,操作专业不卡单几分钟就搞定!复制代码

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 
 5 namespace Microestc.PaginatedList
 6 {
 7     public class PaginatedList<TResult> : List<TResult>
 8     {
 9         public PaginatedList() : base() { }
10 
11         public PaginatedList(IEnumerable<TResult> items, int totalCount, int pageIndex, int pageSize) : base(items)
12         {
13             TotalCount = totalCount;
14             PageCount = (totalCount + pageSize - 1) / pageSize;
15             PageIndex = pageIndex;
16             PageSize = pageSize;
17             HasPrev = pageIndex > 1;
18             HasNext = pageIndex < PageCount;
19         }
20 
21         public virtual int TotalCount { get; private set; }
22 
23         public virtual int PageCount { get; private set; }
24 
25         public virtual int PageIndex { get; private set; }
26 
27         public virtual int PageSize { get; private set; }
28 
29         public virtual bool HasPrev { get; private set; }
30 
31         public virtual bool HasNext { get; private set; }
32     }
33 
34     public static class PaginatedListExtensions
35     {
36         public static PaginatedList<TResult> PaginatedList<TResult>(this IEnumerable<TResult> source, int pageIndex, int pageSize)
37         {
38             var count = source.Count();
39             var items = source.Skip((pageIndex - 1) * pageSize).Take(pageSize);
40             return new PaginatedList<TResult>(items, count, pageIndex, pageSize);
41         }
42 
43         public static PaginatedList<TResult> PaginatedList<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector, int pageIndex, int pageSize)
44         {
45             var count = source.Count();
46             var items = source.Skip((pageIndex - 1) * pageSize).Take(pageSize).Select(selector);
47             return new PaginatedList<TResult>(items, count, pageIndex, pageSize);
48         }
49     }
50 }

标签:扫码,pageSize,int,pageIndex,source,二维码,白条,PaginatedList,public
来源: https://www.cnblogs.com/dfdf55/p/12113538.html