private void ApplyStandardPaging(string skipToken) { if (!string.IsNullOrEmpty(skipToken)) { KeyInstance instance; if (!this.IsPageSizeDefined) { throw DataServiceException.CreateBadRequestError(System.Data.Services.Strings.RequestQueryProcessor_SkipTokenSupportedOnPagedSets); } WebUtil.CheckSyntaxValid(KeyInstance.TryParseNullableTokens(skipToken, out instance)); if (this.topLevelOrderingInfo.OrderingExpressions.Count != instance.PositionalValues.Count) { throw DataServiceException.CreateBadRequestError(System.Data.Services.Strings.DataService_SDP_SkipTokenNotMatchingOrdering(instance.PositionalValues.Count, skipToken, this.topLevelOrderingInfo.OrderingExpressions.Count)); } this.queryExpression = this.queryExpression.QueryableWhere(this.orderingParser.BuildSkipTokenFilter(this.topLevelOrderingInfo, instance)); this.description.VerifyProtocolVersion(RequestDescription.Version2Dot0, this.service); this.description.VerifyRequestVersion(RequestDescription.Version2Dot0, this.service); this.description.VerifyAndRaiseResponseVersion(RequestDescription.Version2Dot0, this.service); } }
private void ApplyCustomPaging(string skipToken) { if (!string.IsNullOrEmpty(skipToken)) { KeyInstance instance; WebUtil.CheckSyntaxValid(KeyInstance.TryParseNullableTokens(skipToken, out instance)); ParameterExpression parameterForIt = Expression.Parameter(this.description.LastSegmentInfo.TargetResourceType.InstanceType, "it"); RequestQueryParser.ExpressionParser parser = new RequestQueryParser.ExpressionParser(this.service, this.description, parameterForIt, string.Empty); object[] skipTokenValues = new object[instance.PositionalValues.Count]; int num = 0; foreach (object obj2 in instance.PositionalValues) { skipTokenValues[num++] = parser.ParseSkipTokenLiteral((string)obj2); } this.CheckAndApplyCustomPaging(skipTokenValues); this.description.VerifyProtocolVersion(RequestDescription.Version2Dot0, this.service); this.description.VerifyRequestVersion(RequestDescription.Version2Dot0, this.service); } else { this.CheckAndApplyCustomPaging(null); } }