File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ namespace ClassLibrary . EFCore . Interfaces ;
2
+
3
+ /// <summary>
4
+ /// Represents a paginated result set.
5
+ /// </summary>
6
+ /// <typeparam name="T">The type of the items in the result set.</typeparam>
7
+ public class PaginatedResult < T >
8
+ {
9
+ /// <summary>
10
+ /// Gets or sets the total number of items.
11
+ /// </summary>
12
+ public int TotalItems { get ; set ; }
13
+
14
+ /// <summary>
15
+ /// Gets or sets the size of each page.
16
+ /// </summary>
17
+ public int PageSize { get ; set ; }
18
+
19
+ /// <summary>
20
+ /// Gets or sets the current page number.
21
+ /// </summary>
22
+ public int CurrentPage { get ; set ; }
23
+
24
+ /// <summary>
25
+ /// Gets the total number of pages.
26
+ /// </summary>
27
+ public int TotalPages => ( int ) Math . Ceiling ( TotalItems / ( double ) PageSize ) ;
28
+
29
+ /// <summary>
30
+ /// Gets or sets the items in the current page.
31
+ /// </summary>
32
+ public List < T > Items { get ; set ; }
33
+
34
+ /// <summary>
35
+ /// Initializes a new instance of the <see cref="PaginatedResult{T}"/> class.
36
+ /// </summary>
37
+ public PaginatedResult ( )
38
+ {
39
+ Items = [ ] ;
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments