本文整理汇总了C#中IQuery.WithPaging方法的典型用法代码示例。如果您正苦于以下问题:C# IQuery.WithPaging方法的具体用法?C# IQuery.WithPaging怎么用?C# IQuery.WithPaging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuery
的用法示例。
在下文中一共展示了IQuery.WithPaging方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSortedOnServerTasks
private PagedData<Task> GetSortedOnServerTasks(IQuery<Task, TaskInclude, TaskFilter, TaskSorter> query, int pageSize, int pageNumber, TaskListColumns column, SortDirection direction)
{
query.WithPaging(pageSize, pageNumber);
switch (column)
{
case TaskListColumns.Title:
{
query.Sort(x => x.ByTitle(direction));
break;
}
case TaskListColumns.Date:
{
query.Sort(x => x.ByDateModified(direction));
break;
}
case TaskListColumns.Type:
{
query.Sort(x => x.ByType(direction));
break;
}
case TaskListColumns.Size:
{
query.Sort(x => x.BySize(direction));
break;
}
case TaskListColumns.Urgency:
{
query.Sort(x => x.ByUrgency(direction));
break;
}
case TaskListColumns.EstimatedPrice:
{
query.Sort(x => x.ByEstimatedPrice(direction));
break;
}
case TaskListColumns.Deadline:
{
query.Sort(x => x.ByDeadline(direction));
break;
}
}
return TaskService.GetAll(query);
}
示例2: GetTasksWithoutSorting
private PagedData<Task> GetTasksWithoutSorting(IQuery<Task, TaskInclude, TaskFilter, TaskSorter> query, int pageSize, int pageNumber)
{
return TaskService.GetAll(query.WithPaging(pageSize, pageNumber));
}
示例3: GetSortedOnServerTasks
private PagedData<Task> GetSortedOnServerTasks(IQuery<Task, ReportInclude, ReportFilter, ReportSorter> query, int pageSize, int pageNumber, ReportListColumns column, SortDirection direction)
{
query.WithPaging(pageSize, pageNumber);
switch (column)
{
case ReportListColumns.Title:
{
query.Sort(x => x.ByTitle(direction));
break;
}
case ReportListColumns.ProjectName:
{
query.Sort(x => x.ByProject(direction));
break;
}
case ReportListColumns.Step:
{
query.Sort(x => x.ByType(direction));
break;
}
}
return TaskService.GetAll(query);
}