29 lines
728 B
C#
29 lines
728 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace WGShare.Domain.GeneralModel
|
|
{
|
|
/// <summary>
|
|
/// 统一分页返回结果模型
|
|
/// </summary>
|
|
/// <typeparam name="TEntity"></typeparam>
|
|
public class PagedResult<TEntity>
|
|
{
|
|
public PagedResult() { }
|
|
public PagedResult(IEnumerable<TEntity> list, int total)
|
|
{
|
|
Total = total;
|
|
Items = list;
|
|
}
|
|
|
|
public int Total { get; set; }
|
|
public IEnumerable<TEntity> Items { get; private set; }
|
|
|
|
public static PagedResult<TEntity> Create(IEnumerable<TEntity> list, int total)
|
|
{
|
|
return new PagedResult<TEntity>(list, total);
|
|
}
|
|
}
|
|
}
|