You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

68 lines
1.8 KiB

using System.Collections.Generic;
using Znyc.Cloudcar.Admin.Commons.Entitys;
namespace Znyc.Cloudcar.Admin.Commons.Pages
{
/// <summary>
/// 保存分页请求的结果。
/// </summary>
/// <typeparam name="T">返回结果集中的POCO类型</typeparam>
public class PageResult<T> : CommonResult
{
public PageResult()
{
}
public PageResult(bool success, string msg, object rows)
{
Success = success;
ErrMsg = msg;
ResData = rows;
}
public PageResult(long currentPage, long totalItems, long itemsPerPage)
{
CurrentPage = currentPage;
TotalItems = totalItems;
ItemsPerPage = itemsPerPage;
}
public PageResult(long currentPage, long totalPages, long totalItems, long itemsPerPage, List<T> items,
object context) : this(currentPage, totalPages, totalItems)
{
ItemsPerPage = itemsPerPage;
Items = items;
Context = context;
}
/// <summary>
/// 当前页码。
/// </summary>
public long CurrentPage { get; set; }
/// <summary>
/// 总页码数。
/// </summary>
public long TotalPages { get; set; }
/// <summary>
/// 记录总数。
/// </summary>
public long TotalItems { get; set; }
/// <summary>
/// 每页数量。
/// </summary>
public long ItemsPerPage { get; set; }
/// <summary>
/// 当前结果集。
/// </summary>
public List<T> Items { get; set; }
/// <summary>
/// 自定义用户属性。
/// </summary>
public object Context { get; set; }
}
}