Class PagedResult
Represents a paged result for a model collection
Inheritance
object
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[Obsolete("Superseded by PagedModel for service layer and below OR PagedViewModel in apis. Expected to be removed when skip/take pattern has been fully implemented v14+")]
[DataContract(Name = "pagedCollection", Namespace = "")]
public abstract class PagedResult
Constructors
View SourcePagedResult(long, long, long)
Initializes a new instance of the PagedResult class.
Declaration
public PagedResult(long totalItems, long pageNumber, long pageSize)
Parameters
| Type | Name | Description |
|---|---|---|
| long | totalItems | The total number of items. |
| long | pageNumber | The current page number (1-based). |
| long | pageSize | The number of items per page. |
Properties
View SourcePageNumber
Gets the current page number (1-based).
Declaration
[DataMember(Name = "pageNumber")]
public long PageNumber { get; }
Property Value
| Type | Description |
|---|---|
| long |
PageSize
Gets the number of items per page.
Declaration
[DataMember(Name = "pageSize")]
public long PageSize { get; }
Property Value
| Type | Description |
|---|---|
| long |
TotalItems
Gets the total number of items across all pages.
Declaration
[DataMember(Name = "totalItems")]
public long TotalItems { get; }
Property Value
| Type | Description |
|---|---|
| long |
TotalPages
Gets the total number of pages.
Declaration
[DataMember(Name = "totalPages")]
public long TotalPages { get; }
Property Value
| Type | Description |
|---|---|
| long |
Methods
View SourceGetSkipSize()
Calculates the skip size based on the paged parameters specified
Declaration
public int GetSkipSize()
Returns
| Type | Description |
|---|---|
| int |
Remarks
Returns 0 if the page number or page size is zero