You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/X.PagedList/BasePagedList.cs
+9-4
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,22 @@
1
1
usingSystem;
2
2
usingSystem.Collections;
3
3
usingSystem.Collections.Generic;
4
+
usingJetBrains.Annotations;
4
5
5
6
namespaceX.PagedList
6
7
{
7
8
/// <summary>
8
-
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
9
+
/// Represents a subset of a collection of objects that can be individually accessed by index and containing
10
+
/// metadata about the superset collection of objects this subset was created from.
9
11
/// </summary>
10
12
/// <remarks>
11
-
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
13
+
/// Represents a subset of a collection of objects that can be individually accessed by index and containing
14
+
/// metadata about the superset collection of objects this subset was created from.
12
15
/// </remarks>
13
16
/// <typeparam name = "T">The type of object the collection should contain.</typeparam>
/// Initializes a new instance of a type deriving from <see cref = "BasePagedList{T}" /> and sets properties needed to calculate position and size data on the subset and superset.
32
+
/// Initializes a new instance of a type deriving from <see cref = "BasePagedList{T}" /> and sets properties
33
+
/// needed to calculate position and size data on the subset and superset.
29
34
/// </summary>
30
35
/// <param name = "pageNumber">The one-based index of the subset of objects contained by this instance.</param>
31
36
/// <param name = "pageSize">The maximum size of any individual subset.</param>
@@ -56,7 +61,7 @@ protected internal BasePagedList(int pageNumber, int pageSize, int totalItemCoun
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
7
-
/// </summary>
8
-
/// <remarks>
9
-
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
10
-
/// </remarks>
11
-
/// <typeparam name="T">The type of object the collection should contain.</typeparam>
/// Gets a non-enumerable copy of this paged list.
28
21
///</summary>
29
22
///<returns>A non-enumerable copy of this paged list.</returns>
30
23
PagedListMetaDataGetMetaData();
31
-
}
24
+
}
32
25
33
-
/// <summary>
34
-
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
35
-
/// </summary>
36
-
/// <remarks>
37
-
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
38
-
/// </remarks>
39
-
publicinterfaceIPagedList
40
-
{
41
-
/// <summary>
42
-
/// Total number of subsets within the superset.
43
-
/// </summary>
44
-
/// <value>
45
-
/// Total number of subsets within the superset.
46
-
/// </value>
47
-
intPageCount{get;}
26
+
/// <summary>
27
+
/// Represents a subset of a collection of objects that can be individually accessed by index and containing
28
+
/// metadata about the superset collection of objects this subset was created from.
29
+
/// </summary>
30
+
/// <remarks>
31
+
/// Represents a subset of a collection of objects that can be individually accessed by index and containing
32
+
/// metadata about the superset collection of objects this subset was created from.
33
+
/// </remarks>
34
+
publicinterfaceIPagedList
35
+
{
36
+
/// <summary>
37
+
/// Total number of subsets within the superset.
38
+
/// </summary>
39
+
/// <value>
40
+
/// Total number of subsets within the superset.
41
+
/// </value>
42
+
intPageCount{get;}
48
43
49
-
/// <summary>
50
-
/// Total number of objects contained within the superset.
51
-
/// </summary>
52
-
/// <value>
53
-
/// Total number of objects contained within the superset.
54
-
/// </value>
55
-
intTotalItemCount{get;}
44
+
/// <summary>
45
+
/// Total number of objects contained within the superset.
46
+
/// </summary>
47
+
/// <value>
48
+
/// Total number of objects contained within the superset.
49
+
/// </value>
50
+
intTotalItemCount{get;}
56
51
57
-
/// <summary>
58
-
/// One-based index of this subset within the superset, zero if the superset is empty.
59
-
/// </summary>
60
-
/// <value>
61
-
/// One-based index of this subset within the superset, zero if the superset is empty.
62
-
/// </value>
63
-
intPageNumber{get;}
52
+
/// <summary>
53
+
/// One-based index of this subset within the superset, zero if the superset is empty.
54
+
/// </summary>
55
+
/// <value>
56
+
/// One-based index of this subset within the superset, zero if the superset is empty.
57
+
/// </value>
58
+
intPageNumber{get;}
64
59
65
-
/// <summary>
66
-
/// Maximum size any individual subset.
67
-
/// </summary>
68
-
/// <value>
69
-
/// Maximum size any individual subset.
70
-
/// </value>
71
-
intPageSize{get;}
60
+
/// <summary>
61
+
/// Maximum size any individual subset.
62
+
/// </summary>
63
+
/// <value>
64
+
/// Maximum size any individual subset.
65
+
/// </value>
66
+
intPageSize{get;}
72
67
73
-
/// <summary>
74
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is NOT the first subset within the superset.
75
-
/// </summary>
76
-
/// <value>
77
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is NOT the first subset within the superset.
78
-
/// </value>
79
-
boolHasPreviousPage{get;}
68
+
/// <summary>
69
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
70
+
/// is NOT the first subset within the superset.
71
+
/// </summary>
72
+
/// <value>
73
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
74
+
/// is NOT the first subset within the superset.
75
+
/// </value>
76
+
boolHasPreviousPage{get;}
80
77
81
-
/// <summary>
82
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is NOT the last subset within the superset.
83
-
/// </summary>
84
-
/// <value>
85
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is NOT the last subset within the superset.
86
-
/// </value>
87
-
boolHasNextPage{get;}
78
+
/// <summary>
79
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
80
+
/// is NOT the last subset within the superset.
81
+
/// </summary>
82
+
/// <value>
83
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
84
+
/// is NOT the last subset within the superset.
85
+
/// </value>
86
+
boolHasNextPage{get;}
88
87
89
-
/// <summary>
90
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is the first subset within the superset.
91
-
/// </summary>
92
-
/// <value>
93
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is the first subset within the superset.
94
-
/// </value>
95
-
boolIsFirstPage{get;}
88
+
/// <summary>
89
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
90
+
/// is the first subset within the superset.
91
+
/// </summary>
92
+
/// <value>
93
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
94
+
/// is the first subset within the superset.
95
+
/// </value>
96
+
boolIsFirstPage{get;}
96
97
97
-
/// <summary>
98
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is the last subset within the superset.
99
-
/// </summary>
100
-
/// <value>
101
-
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this is the last subset within the superset.
102
-
/// </value>
103
-
boolIsLastPage{get;}
98
+
/// <summary>
99
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
100
+
/// is the last subset within the superset.
101
+
/// </summary>
102
+
/// <value>
103
+
/// Returns true if the superset is not empty and PageNumber is less than or equal to PageCount and this
104
+
/// is the last subset within the superset.
105
+
/// </value>
106
+
boolIsLastPage{get;}
104
107
105
-
/// <summary>
106
-
/// One-based index of the first item in the paged subset, zero if the superset is empty or PageNumber is greater than PageCount.
107
-
/// </summary>
108
-
/// <value>
109
-
/// One-based index of the first item in the paged subset, zero if the superset is empty or PageNumber is greater than PageCount.
110
-
/// </value>
111
-
intFirstItemOnPage{get;}
108
+
/// <summary>
109
+
/// One-based index of the first item in the paged subset, zero if the superset is empty or PageNumber
110
+
/// is greater than PageCount.
111
+
/// </summary>
112
+
/// <value>
113
+
/// One-based index of the first item in the paged subset, zero if the superset is empty or PageNumber
114
+
/// is greater than PageCount.
115
+
/// </value>
116
+
intFirstItemOnPage{get;}
112
117
113
-
/// <summary>
114
-
/// One-based index of the last item in the paged subset, zero if the superset is empty or PageNumber is greater than PageCount.
115
-
/// </summary>
116
-
/// <value>
117
-
/// One-based index of the last item in the paged subset, zero if the superset is empty or PageNumber is greater than PageCount.
118
-
/// </value>
119
-
intLastItemOnPage{get;}
120
-
}
118
+
/// <summary>
119
+
/// One-based index of the last item in the paged subset, zero if the superset is empty or PageNumber
120
+
/// is greater than PageCount.
121
+
/// </summary>
122
+
/// <value>
123
+
/// One-based index of the last item in the paged subset, zero if the superset is empty or PageNumber
Copy file name to clipboardexpand all lines: src/X.PagedList/PagedList.cs
+34-11
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,26 @@
2
2
usingSystem.Collections.Generic;
3
3
usingSystem.Linq;
4
4
usingSystem.Linq.Expressions;
5
+
usingJetBrains.Annotations;
5
6
6
7
namespaceX.PagedList
7
8
{
9
+
[PublicAPI]
8
10
publicclassPagedList<T,TKey>:BasePagedList<T>
9
11
{
10
12
/// <summary>
11
-
/// Initializes a new instance of the <see cref="PagedList{T}"/> class that divides the supplied superset into subsets the size of the supplied pageSize. The instance then only containes the objects contained in the subset specified by index.
13
+
/// Initializes a new instance of the <see cref="PagedList{T}"/> class that divides the supplied superset into
14
+
/// subsets the size of the supplied pageSize. The instance then only contains the objects contained in the
15
+
/// subset specified by index.
12
16
/// </summary>
13
-
/// <param name="superset">The collection of objects to be divided into subsets. If the collection implements <see cref="IQueryable{T}"/>, it will be treated as such.</param>
17
+
/// <param name="superset">
18
+
/// The collection of objects to be divided into subsets. If the collection
19
+
/// implements <see cref="IQueryable{T}"/>, it will be treated as such.
20
+
/// </param>
14
21
/// <param name="keySelector">Expression for Order</param>
15
-
/// <param name="pageNumber">The one-based index of the subset of objects to be contained by this instance.</param>
22
+
/// <param name="pageNumber">
23
+
/// The one-based index of the subset of objects to be contained by this instance.
24
+
/// </param>
16
25
/// <param name="pageSize">The maximum size of any individual subset.</param>
17
26
/// <exception cref="ArgumentOutOfRangeException">The specified index cannot be less than zero.</exception>
18
27
/// <exception cref="ArgumentOutOfRangeException">The specified page size cannot be less than one.</exception>
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
60
+
/// Represents a subset of a collection of objects that can be individually accessed by index and containing
61
+
/// metadata about the superset collection of objects this subset was created from.
52
62
/// </summary>
53
63
/// <remarks>
54
-
/// Represents a subset of a collection of objects that can be individually accessed by index and containing metadata about the superset collection of objects this subset was created from.
64
+
/// Represents a subset of a collection of objects that can be individually accessed by index and containing
65
+
/// metadata about the superset collection of objects this subset was created from.
55
66
/// </remarks>
56
67
/// <typeparam name="T">The type of object the collection should contain.</typeparam>
/// Initializes a new instance of the <see cref="PagedList{T}"/> class that divides the supplied superset into subsets the size of the supplied pageSize. The instance then only containes the objects contained in the subset specified by index.
75
+
/// Initializes a new instance of the <see cref="PagedList{T}"/> class that divides the supplied superset
76
+
/// into subsets the size of the supplied pageSize. The instance then only contains the objects contained
77
+
/// in the subset specified by index.
65
78
/// </summary>
66
-
/// <param name="superset">The collection of objects to be divided into subsets. If the collection implements <see cref="IQueryable{T}"/>, it will be treated as such.</param>
67
-
/// <param name="pageNumber">The one-based index of the subset of objects to be contained by this instance.</param>
79
+
/// <param name="superset">
80
+
/// The collection of objects to be divided into subsets. If the collection
81
+
/// implements <see cref="IQueryable{T}"/>, it will be treated as such.
82
+
/// </param>
83
+
/// <param name="pageNumber">
84
+
/// The one-based index of the subset of objects to be contained by this instance.
85
+
/// </param>
68
86
/// <param name="pageSize">The maximum size of any individual subset.</param>
69
87
/// <exception cref="ArgumentOutOfRangeException">The specified index cannot be less than zero.</exception>
70
88
/// <exception cref="ArgumentOutOfRangeException">The specified page size cannot be less than one.</exception>
@@ -81,9 +99,14 @@ public PagedList(IQueryable<T> superset, int pageNumber, int pageSize)
81
99
}
82
100
83
101
/// <summary>
84
-
/// Initializes a new instance of the <see cref="PagedList{T}"/> class that divides the supplied superset into subsets the size of the supplied pageSize. The instance then only containes the objects contained in the subset specified by index.
102
+
/// Initializes a new instance of the <see cref="PagedList{T}"/> class that divides the supplied superset
103
+
/// into subsets the size of the supplied pageSize. The instance then only contains the objects contained in
104
+
/// the subset specified by index.
85
105
/// </summary>
86
-
/// <param name="superset">The collection of objects to be divided into subsets. If the collection implements <see cref="IQueryable{T}"/>, it will be treated as such.</param>
106
+
/// <param name="superset">
107
+
/// The collection of objects to be divided into subsets. If the collection
108
+
/// implements <see cref="IQueryable{T}"/>, it will be treated as such.
109
+
/// </param>
87
110
/// <param name="pageNumber">The one-based index of the subset of objects to be contained by this instance.</param>
88
111
/// <param name="pageSize">The maximum size of any individual subset.</param>
89
112
/// <exception cref="ArgumentOutOfRangeException">The specified index cannot be less than zero.</exception>
0 commit comments