我对编写的QueryExpression有多重请求。在某些情况下,五千多返回的记录,而在其他国家则返回小于5000条记录。我担心如果计数少于5000,将失败。这是真的吗?!
QueryExpression queryService = conversionResponse.Query;
int pageNumber = 1;
RetrieveMultipleRequest multiRequest;
RetrieveMultipleResponse multiResponse = new RetrieveMultipleResponse();
do
{
queryService.PageInfo.Count = 5000;
queryService.PageInfo.PagingCookie = (pageNumber == 1) ? null : multiResponse.EntityCollection.PagingCookie;
queryService.PageInfo.PageNumber = pageNumber++;
multiRequest = new RetrieveMultipleRequest
{
Query = queryService
};
multiResponse = (RetrieveMultipleResponse)service.Execute(multiRequest);
Allergies.Entities.AddRange(multiResponse.EntityCollection.Entities);
} while (multiResponse.EntityCollection.MoreRecords);