Example #1
0
        /// <summary>
        /// Create an expand term token
        /// </summary>
        /// <param name="pathToNavProp">the nav prop for this expand term</param>
        /// <param name="filterOption">the filter option for this expand term</param>
        /// <param name="orderByOption">the orderby option for this expand term</param>
        /// <param name="topOption">the top option for this expand term</param>
        /// <param name="skipOption">the skip option for this expand term</param>
        /// <param name="inlineCountOption">the inlineCountOption for this expand term</param>
        /// <param name="selectOption">the select option for this expand term</param>
        /// <param name="expandOption">the expand option for this expand term</param>
        public ExpandTermToken(PathSegmentToken pathToNavProp, QueryToken filterOption, OrderByToken orderByOption, long?topOption, long?skipOption, InlineCountKind?inlineCountOption, SelectToken selectOption, ExpandToken expandOption)
        {
            ExceptionUtils.CheckArgumentNotNull(pathToNavProp, "property");

            this.pathToNavProp     = pathToNavProp;
            this.filterOption      = filterOption;
            this.orderByOption     = orderByOption;
            this.topOption         = topOption;
            this.skipOption        = skipOption;
            this.inlineCountOption = inlineCountOption;
            this.selectOption      = selectOption;
            this.expandOption      = expandOption;
        }
Example #2
0
        /// <summary>
        /// Visits the top level select token
        /// </summary>
        /// <param name="tokenIn">the select token to visit</param>
        /// <returns>A new SelectExpandClause decorated with the information from the selectToken</returns>
        public SelectExpandClause Bind(SelectToken tokenIn)
        {
            if (tokenIn == null || !tokenIn.Properties.Any())
            {
                this.visitor.DecoratedExpandClause.SetAllSelectionRecursively();
            }
            else
            {
                foreach (PathSegmentToken property in tokenIn.Properties)
                {
                    property.Accept(this.visitor);
                }
            }

            return(this.visitor.DecoratedExpandClause);
        }
Example #3
0
 /// <summary>
 /// Decorate an expand tree using a select token.
 /// </summary>
 /// <param name="subExpand">the already built sub expand</param>
 /// <param name="currentNavProp">the current navigation property</param>
 /// <param name="select">the select token to use</param>
 /// <returns>A new SelectExpand clause decorated with the select token.</returns>
 protected override SelectExpandClause DecorateExpandWithSelect(SelectExpandClause subExpand, IEdmNavigationProperty currentNavProp, SelectToken select)
 {
     Debug.Assert(select == null, "Should not have select on individual expand items for this binder, because the V3 syntax does not support selects within the $expand clause.");
     return(subExpand);
 }
Example #4
0
 /// <summary>
 /// Decorate an expand tree using a select token.
 /// </summary>
 /// <param name="subExpand">the already built sub expand</param>
 /// <param name="currentNavProp">the current navigation property</param>
 /// <param name="select">the select token to use</param>
 /// <returns>A new SelectExpand clause decorated with the select token.</returns>
 protected abstract SelectExpandClause DecorateExpandWithSelect(SelectExpandClause subExpand, IEdmNavigationProperty currentNavProp, SelectToken select);
Example #5
0
 /// <summary>
 /// Visits a SelectToken
 /// </summary>
 /// <param name="tokenIn">The SelectToken to bind</param>
 /// <returns>A QueryNode bound to this SelectToken</returns>
 public virtual T Visit(SelectToken tokenIn)
 {
     throw new NotImplementedException();
 }
Example #6
0
        /// <summary>
        /// Decorate an expand tree using a select token.
        /// </summary>
        /// <param name="subExpand">the already built sub expand</param>
        /// <param name="currentNavProp">the current navigation property</param>
        /// <param name="select">the select token to use</param>
        /// <returns>A new SelectExpand clause decorated with the select token.</returns>
        protected override SelectExpandClause DecorateExpandWithSelect(SelectExpandClause subExpand, IEdmNavigationProperty currentNavProp, SelectToken select)
        {
            SelectBinder selectBinder = new SelectBinder(this.Model, currentNavProp.ToEntityType(), this.Settings.SelectExpandLimit, subExpand);

            return(selectBinder.Bind(select));
        }