| | | 1 | | // ReSharper disable once CheckNamespace |
| | | 2 | | namespace Microsoft.EntityFrameworkCore; |
| | | 3 | | |
| | | 4 | | /// <summary>One page of query results plus the paging totals.</summary> |
| | | 5 | | /// <typeparam name="T">The item type.</typeparam> |
| | | 6 | | public class PagedResult< T > |
| | | 7 | | where T : class |
| | | 8 | | { |
| | | 9 | | /// <summary>The 1-based page number.</summary> |
| | | 10 | | public int PageNumber { get; set; } |
| | | 11 | | |
| | | 12 | | /// <summary>The number of items per page.</summary> |
| | | 13 | | public int PageSize { get; set; } |
| | | 14 | | |
| | | 15 | | /// <summary>The number of items across all pages.</summary> |
| | | 16 | | public int TotalCount { get; set; } |
| | | 17 | | |
| | | 18 | | /// <summary>The number of pages.</summary> |
| | | 19 | | public int TotalPages { get; set; } |
| | | 20 | | |
| | | 21 | | /// <summary>The items on this page. Default: empty.</summary> |
| | 12 | 22 | | public IList<T> Items { get; set; } = []; |
| | | 23 | | |
| | | 24 | | /// <summary>Whether a page follows this one.</summary> |
| | 8 | 25 | | public bool HasNextPage => PageNumber < TotalPages; |
| | | 26 | | } |