コード例 #1
0
        protected virtual string BuildGetUrl(Expression <Func <T, bool> > query, int top, int skip)
        {
            string orderBySegment = OrderByField + "+";

            orderBySegment += OrderAscending ? "asc" : "desc";
            string url = String.Format("{0}?$filter={1}&$top={2}&$select={3}&$orderby={4}", Url, UrlBuilder.BuildFilterClause(query), UrlBuilder.BuildTop(top), UrlBuilder.BuildSelect(), orderBySegment);

            if (skip > 0)
            {
                url += "&$skip=" + UrlBuilder.BuildSkip(skip);
            }
            string expand = UrlBuilder.BuildExpand();

            if (!String.IsNullOrEmpty(expand))
            {
                url += "&$expand=" + expand;
            }
            return(url);
        }