mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 17:31:42 +08:00
36 lines
871 B
C#
36 lines
871 B
C#
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text.Json.Serialization;
|
|||
|
|
|||
|
namespace AntDesign.TableModels
|
|||
|
{
|
|||
|
public class QueryModel<TItem>
|
|||
|
{
|
|||
|
public int PageIndex { get; }
|
|||
|
|
|||
|
public int PageSize { get; }
|
|||
|
|
|||
|
public IList<ITableSortModel> SortModel { get; private set; }
|
|||
|
|
|||
|
[JsonIgnore]
|
|||
|
public IQueryable<TItem> QueryableLambda { get; private set; }
|
|||
|
|
|||
|
internal QueryModel(int pageIndex, int pageSize)
|
|||
|
{
|
|||
|
this.PageSize = pageSize;
|
|||
|
this.PageIndex = pageIndex;
|
|||
|
}
|
|||
|
|
|||
|
internal void AddSortModel(ITableSortModel model)
|
|||
|
{
|
|||
|
SortModel ??= new List<ITableSortModel>();
|
|||
|
SortModel.Add(model);
|
|||
|
}
|
|||
|
|
|||
|
internal void SetQueryableLambda(IQueryable<TItem> query)
|
|||
|
{
|
|||
|
this.QueryableLambda = query;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|