Pip-Services-Commons-Dotnet
Public Member Functions | Properties | List of all members
PipServices3.Commons.Data.DataPage< T > Class Template Reference

Data transfer object that is used to pass results of paginated queries. It contains items of retrieved page and optional total number of items. More...

Public Member Functions

 DataPage ()
 Creates a new instance of data page. More...
 
 DataPage (List< T > data, long? total=null)
 Creates a new instance of data page and assigns its values. More...
 

Properties

long Total [get, set]
 
List< T > Data [get, set]
 

Detailed Description

Data transfer object that is used to pass results of paginated queries. It contains items of retrieved page and optional total number of items.

Most often this object type is used to send responses to paginated queries. Pagination parameters are defined by PagingParams object. The skip parameter in the PagingParams there means how many items to skip. The takes parameter sets number of items to return in the page. And the optional total parameter tells to return total number of items in the query.

Remember: not all implementations support total parameter because its generation may lead to severe performance implications.

Template Parameters
Tthe class type
myDataClient.GetDataByFilter(
"123",
FilterParams.FromTuples("completed", true),
new PagingParams(0, 100, true),
async(DataPage<MyData> page) => {
Console.WriteLine("Items: ");
for (MyData item : page.getData()) {
Console.WriteLine(item);
}
Console.WriteLine("Total items: " + page.getTotal());
};
);

See PagingParams

Constructor & Destructor Documentation

◆ DataPage() [1/2]

Creates a new instance of data page.

◆ DataPage() [2/2]

PipServices3.Commons.Data.DataPage< T >.DataPage ( List< T >  data,
long?  total = null 
)

Creates a new instance of data page and assigns its values.

Parameters
dataa list of items from the retrieved page.
total(optional) .

Property Documentation

◆ Data

List<T> PipServices3.Commons.Data.DataPage< T >.Data
getset

The items of the retrieved page.

◆ Total

long PipServices3.Commons.Data.DataPage< T >.Total
getset

The total amount of items in a request.


The documentation for this class was generated from the following file: