コード例 #1
0
ファイル: ViewBase.cs プロジェクト: ivfranji/GraphManagedApi
        /// <summary>
        /// Get url query.
        /// </summary>
        /// <returns></returns>
        public string GetUrlQuery()
        {
            if (this.PropertySet.UrlQueryEmpty)
            {
                return(this.PageQuery.GetUrlQuery());
            }

            CompositeQuery compositeQuery = new CompositeQuery(new IUrlQuery[] { this.PageQuery, this.PropertySet });

            return(compositeQuery.GetUrlQuery());
        }
コード例 #2
0
        /// <summary>
        /// Get url query.
        /// </summary>
        /// <returns></returns>
        public string GetUrlQuery()
        {
            if (this.UrlQueryEmpty)
            {
                return(null);
            }

            IUrlQuery urlQuery = null;

            if (null != this.expandablePropertySet)
            {
                urlQuery = this.expandablePropertySet;
            }

            if (this.requestedProperties.Count == 0)
            {
                return(urlQuery.GetUrlQuery());
            }

            PropertyDefinition[] properties = new PropertyDefinition[this.requestedProperties.Count + this.firstClassProperties.Count];
            int counter = 0;

            // always add first class properties if at least one property added.
            for (int i = 0; i < this.firstClassProperties.Count; i++)
            {
                properties[counter++] = this.firstClassProperties[i];
            }

            for (int i = 0; i < this.requestedProperties.Count; i++)
            {
                properties[counter++] = this.requestedProperties[i];
            }

            SelectQuery selectQuery = new SelectQuery(properties);

            if (null != urlQuery)
            {
                CompositeQuery compositeQuery = new CompositeQuery(new IUrlQuery[] { selectQuery, urlQuery });
                return(compositeQuery.GetUrlQuery());
            }

            return(selectQuery.GetUrlQuery());
        }