有没有办法限制从 RetreiveMultiple 返回的结果数量?
我正在做与以下非常相似的事情:
ColumnSet cols = new ColumnSet();
// Set the properties of the ColumnSet.
cols.Attributes = new string [] {"fullname", "contactid"};
// Create the ConditionExpression.
ConditionExpression condition = new ConditionExpression();
// Set the condition for the retrieval to be when the contact's address' city is Sammamish.
condition.AttributeName = "address1_city";
condition.Operator = ConditionOperator.Like;
condition.Values = new string [] {"Sammamish"};
// Create the FilterExpression.
FilterExpression filter = new FilterExpression();
// Set the properties of the filter.
filter.FilterOperator = LogicalOperator.And;
filter.Conditions = new ConditionExpression[] {condition};
// Create the QueryExpression object.
QueryExpression query = new QueryExpression();
// Set the properties of the QueryExpression object.
query.EntityName = EntityName.contact.ToString();
query.ColumnSet = cols;
query.Criteria = filter;
// Retrieve the contacts.
BusinessEntityCollection contacts = service.RetrieveMultiple(query);