Pip-Services-Commons-Dotnet
Public Member Functions | Static Public Member Functions | Properties | List of all members
PipServices3.Commons.Data.PagingParams Class Reference

Data transfer object to pass paging parameters for queries. The page is defined by two parameters. The skip parameter defines number of items to skip. The Paging parameter sets how many items to return in a page. And the optional total parameter tells to return total number of items in the query. More...

Public Member Functions

 PagingParams ()
 Creates a new instance and sets its values. More...
 
 PagingParams (object skip, object take, object total=null)
 Creates a new instance and sets its values. More...
 
long GetSkip (long minSkip=0)
 Gets the number of items to skip. More...
 
long GetTake (long maxTake)
 Gets the number of items to return in a page. More...
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static PagingParams FromValue (object value)
 Converts specified value into PagingParams. More...
 
static PagingParams FromTuples (params object[] tuples)
 Creates a new PagingParams from a list of key-value pairs called tuples. More...
 
static PagingParams FromMap (AnyValueMap map)
 Creates a new PagingParams and sets it parameters from the AnyValueMap map More...
 

Properties

long Skip [get, set]
 
long Take [get, set]
 
bool Total [get, set]
 

Detailed Description

Data transfer object to pass paging parameters for queries. The page is defined by two parameters. The skip parameter defines number of items to skip. The Paging parameter sets how many items to return in a 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.

var filter = FilterParams.FromTuples("type", "Type1");
var paging = new PagingParams(0, 100);
myDataClient.GetDataByFilter(filter, paging);

Constructor & Destructor Documentation

◆ PagingParams() [1/2]

PipServices3.Commons.Data.PagingParams.PagingParams ( )

Creates a new instance and sets its values.

◆ PagingParams() [2/2]

PipServices3.Commons.Data.PagingParams.PagingParams ( object  skip,
object  take,
object  total = null 
)

Creates a new instance and sets its values.

Parameters
skipthe number of items to skip.
takethe number of items to return.
totaltrue to return the total number of items.

Member Function Documentation

◆ FromMap()

static PagingParams PipServices3.Commons.Data.PagingParams.FromMap ( AnyValueMap  map)
static

Creates a new PagingParams and sets it parameters from the AnyValueMap map

Parameters
mapa AnyValueMap to initialize this PagingParams
Returns
a newly created PagingParams.

◆ FromTuples()

static PagingParams PipServices3.Commons.Data.PagingParams.FromTuples ( params object []  tuples)
static

Creates a new PagingParams from a list of key-value pairs called tuples.

Parameters
tuplesa list of values where odd elements are keys and the following even elements are values
Returns
a newly created PagingParams.

◆ FromValue()

static PagingParams PipServices3.Commons.Data.PagingParams.FromValue ( object  value)
static

Converts specified value into PagingParams.

Parameters
valuevalue to be converted
Returns
a newly created PagingParams.

◆ GetSkip()

long PipServices3.Commons.Data.PagingParams.GetSkip ( long  minSkip = 0)

Gets the number of items to skip.

Parameters
minSkipthe minimum number of items to skip.
Returns
the number of items to skip.

◆ GetTake()

long PipServices3.Commons.Data.PagingParams.GetTake ( long  maxTake)

Gets the number of items to return in a page.

Parameters
maxTakethe maximum number of items to return.
Returns
the number of items to return.

Property Documentation

◆ Skip

long PipServices3.Commons.Data.PagingParams.Skip
getset

The number of items to skip.

◆ Take

long PipServices3.Commons.Data.PagingParams.Take
getset

The number of items to return.

◆ Total

bool PipServices3.Commons.Data.PagingParams.Total
getset

The flag to return the total number of items.


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