...
Info |
---|
The feature is backward compatible, which means the property |
The results of a paginated method are ordered by creation time in ascending order, from the oldest records to the newest. In this approach, a new entity will never interrupt the pagination and will be added as a new entity on the latest or a new page. Only the delete operation can shift entities toward the beginning of the enumeration. Creating a new entity is much more likely than deleting an existing one. Be aware of filters that can more likely affect the returned entities between pages.
Note |
---|
A delete operation can shift entities on a page, which may lead to skipping some entities. Additionally, filters can further complicate this issue, as any updated entities might be excluded between page requests. |
Supported methods
API method | SDK service and method |
---|---|
...
Property | Description | |||||
---|---|---|---|---|---|---|
EnablePagination | optional | It must be set to
false
| ||||
PageSize | optional | Defines the size of a page; the value has boundaries from 1 to 5000. Negative, zero, and values higher than 5000 are not allowed. The default value is 2000. | ||||
PageIndex | optional | Used to iterate through pages. The valid value is from 0 to N. Negative values are not allowed. The default value is 0. |
Example of usage by the SDK
The SDK uses IAsyncEnumerable<>
interface to process the requests for each page asynchronously.
Code Block | ||
---|---|---|
| ||
var entitiesCount = 0; var pageCount = 0; var service = provider.GetRequiredService<IBfsLegalEntitiesService>(); await foreach (var response in service.GetLegalEntitiesInPagesAsync(new GetPersonArgs())) { entitiesCount += response.Result.Length; pageCount++; foreach (var entity in response.Result) { ProcessEntity(entity); } } |
...