Exemplo n.º 1
0
        private StringBuilder GetNextPageQueryParametersForRootContainer()
        {
            StringBuilder builder = new StringBuilder();

            if (this.RequestDescription.SegmentInfos[0].TargetSource == RequestTargetSource.ServiceOperation)
            {
                foreach (OperationParameter parameter in this.RequestDescription.SegmentInfos[0].Operation.Parameters)
                {
                    if (builder.Length > 0)
                    {
                        builder.Append('&');
                    }
                    builder.Append(parameter.Name).Append('=');
                    string str = DataStringEscapeBuilder.EscapeDataString(this.service.OperationContext.Host.GetQueryStringItem(parameter.Name));
                    builder.Append(str);
                }
            }
            foreach (string str2 in NextPageQueryParametersToCopy)
            {
                string queryStringItem = this.service.OperationContext.Host.GetQueryStringItem(str2);
                if (!string.IsNullOrEmpty(queryStringItem))
                {
                    if (builder.Length > 0)
                    {
                        builder.Append('&');
                    }
                    builder.Append(str2).Append('=').Append(DataStringEscapeBuilder.EscapeDataString(queryStringItem));
                }
            }
            int?topQueryParameter = this.GetTopQueryParameter();

            if (topQueryParameter.HasValue)
            {
                int num = topQueryParameter.Value;
                if (!this.IsCustomPaged)
                {
                    num = topQueryParameter.Value - this.CurrentContainer.PageSize;
                }
                else
                {
                    num = topQueryParameter.Value - this.segmentInfo.CurrentResultCount;
                }
                if (num > 0)
                {
                    if (builder.Length > 0)
                    {
                        builder.Append('&');
                    }
                    builder.Append("$top").Append('=').Append(num);
                }
            }
            if (builder.Length > 0)
            {
                builder.Append('&');
            }
            return(builder);
        }
Exemplo n.º 2
0
        internal static string EscapeDataString(string input)
        {
            DataStringEscapeBuilder builder = new DataStringEscapeBuilder(input);

            return(builder.Build());
        }
Exemplo n.º 3
0
 internal static string EscapeDataString(string input)
 {
     DataStringEscapeBuilder builder = new DataStringEscapeBuilder(input);
     return builder.Build();
 }