using System.Collections.Generic; using System.Linq; using System.Text.Json.Serialization; namespace AntDesign.TableModels { public class QueryModel { public int PageIndex { get; } public int PageSize { get; } public IList SortModel { get; private set; } public IList FilterModel { get; private set; } public QueryModel() { this.SortModel = new List(); this.FilterModel = new List(); } internal QueryModel(int pageIndex, int pageSize) { this.PageSize = pageSize; this.PageIndex = pageIndex; this.SortModel = new List(); this.FilterModel = new List(); } } public class QueryModel : QueryModel { [JsonIgnore] public IQueryable QueryableLambda { get; private set; } internal QueryModel(int pageIndex, int pageSize) : base(pageIndex, pageSize) { } internal void AddSortModel(ITableSortModel model) { SortModel.Add(model); } internal void AddFilterModel(ITableFilterModel model) { FilterModel.Add(model); } internal void SetQueryableLambda(IQueryable query) { this.QueryableLambda = query; } } }