You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace Common.Utilities
|
|
|
|
|
{
|
|
|
|
|
public class PageModel<T>
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 第几页,从1开始
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int PageNumber { get; set; } = 1;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 总页数
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int PageCount => (int)Math.Ceiling((decimal)Count / PageSize);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询的记录数量
|
|
|
|
|
/// </summary>
|
|
|
|
|
public long Count { get; set; } = 0;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 每页大小
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int PageSize { set; get; } = 20;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 返回数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<T> Result { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PageModel() { }
|
|
|
|
|
|
|
|
|
|
public PageModel(int pageNumber, long count, int pageSize, List<T> result)
|
|
|
|
|
{
|
|
|
|
|
PageNumber = pageNumber;
|
|
|
|
|
Count = count;
|
|
|
|
|
PageSize = pageSize;
|
|
|
|
|
Result = result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|