当前位置: 首页>>代码示例>>C#>>正文


C# QueryToken类代码示例

本文整理汇总了C#中QueryToken的典型用法代码示例。如果您正苦于以下问题:C# QueryToken类的具体用法?C# QueryToken怎么用?C# QueryToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QueryToken类属于命名空间,在下文中一共展示了QueryToken类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindFilter

        /// <summary>
        /// Binds the given filter token.
        /// </summary>
        /// <param name="filter">The filter token to bind.</param>
        /// <returns>A FilterNode with the given path linked to it (if provided).</returns>
        internal FilterClause BindFilter(QueryToken filter)
        {
            ExceptionUtils.CheckArgumentNotNull(filter, "filter");

            QueryNode expressionNode = this.bindMethod(filter);

            SingleValueNode expressionResultNode = expressionNode as SingleValueNode;
            if (expressionResultNode == null ||
                (expressionResultNode.TypeReference != null && !expressionResultNode.TypeReference.IsODataPrimitiveTypeKind()))
            {
                throw new ODataException(ODataErrorStrings.MetadataBinder_FilterExpressionNotSingleValue);
            }

            // The type may be null here if the query statically represents the null literal or an open property.
            IEdmTypeReference expressionResultType = expressionResultNode.TypeReference;
            if (expressionResultType != null)
            {
                IEdmPrimitiveTypeReference primitiveExpressionResultType = expressionResultType.AsPrimitiveOrNull();
                if (primitiveExpressionResultType == null ||
                    primitiveExpressionResultType.PrimitiveKind() != EdmPrimitiveTypeKind.Boolean)
                {
                    throw new ODataException(ODataErrorStrings.MetadataBinder_FilterExpressionNotSingleValue);
                }
            }

            FilterClause filterNode = new FilterClause(expressionResultNode, this.state.ImplicitRangeVariable);

            return filterNode;
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:34,代码来源:FilterBinder.cs

示例2: QueryTokenBuilder_SubTokensEvent

        private List<QueryToken> QueryTokenBuilder_SubTokensEvent(QueryToken arg)
        {
            if (SubTokensEvent == null)
                throw new InvalidOperationException("SubTokensEvent not set");

            return SubTokensEvent(arg);
        }
开发者ID:JackWangCUMT,项目名称:extensions,代码行数:7,代码来源:QueryTokenDNBuilder.xaml.cs

示例3: CountToken

        internal CountToken(QueryToken parent)
            : base(parent)
        {
            if (parent == null)
                throw new ArgumentNullException("parent");

        }
开发者ID:nuub666,项目名称:framework,代码行数:7,代码来源:CountToken.cs

示例4: PropertyAccessQueryToken

        /// <summary>
        /// Create a PropertyAccessQueryToken given the name and the parent (if any)
        /// </summary>
        /// <param name="name">The name of the property to access.</param>
        /// <param name="parent">The parent token to access the property on.  Pass no if this property has no parent.</param>
        public PropertyAccessQueryToken(string name, QueryToken parent)
        {
            ExceptionUtils.CheckArgumentStringNotNullOrEmpty(name, "name");

            this.name = name;
            this.parent = parent;
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:12,代码来源:PropertyAccessQueryToken.cs

示例5: UnaryOperatorQueryToken

        /// <summary>
        /// Create a new UnaryOperatorQueryToken given the operator and operand
        /// </summary>
        /// <param name="operatorKind">The operator represented by this node.</param>
        /// <param name="operand">The operand.</param>
        public UnaryOperatorQueryToken(UnaryOperatorKind operatorKind, QueryToken operand)
        {
            ExceptionUtils.CheckArgumentNotNull(operand, "operand");

            this.operatorKind = operatorKind;
            this.operand = operand;
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:12,代码来源:UnaryOperatorQueryToken.cs

示例6: OrderByQueryToken

        /// <summary>
        /// Create a new OrderByQueryToken given the expression and direction
        /// </summary>
        /// <param name="expression">The expression according to which to order the results.</param>
        /// <param name="direction">The direction of the ordering.</param>
        public OrderByQueryToken(QueryToken expression, OrderByDirection direction)
        {
            ExceptionUtils.CheckArgumentNotNull(expression, "expression");

            this.expression = expression;
            this.direction = direction;
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:12,代码来源:OrderByQueryToken.cs

示例7: ToString

 private static string ToString(QueryToken t)
 {
     if (t.Parts.Length == 1) { return t.Parts[0]; }
     string str = "\"";
     foreach (string part in t.Parts) { str += part + " "; }
     return str.TrimEnd(' ') + "\"";
 }
开发者ID:SowaLabs,项目名称:QueryLib,代码行数:7,代码来源:QueryToken.cs

示例8: HasValueToken

        internal HasValueToken(QueryToken parent)
            : base(parent)
        {
            if (parent == null)
                throw new ArgumentNullException("parent");

            this.Priority = -1;
        }
开发者ID:signumsoftware,项目名称:framework,代码行数:8,代码来源:HasValueToken.cs

示例9: QueryTokenBuilderOrders_SubTokensEvent

        private List<QueryToken> QueryTokenBuilderOrders_SubTokensEvent(QueryToken token)
        {
            var cr = (UserChartEntity)DataContext;
            if (cr == null || QueryDescription == null)
                return new List<QueryToken>();

            return token.SubTokens(QueryDescription, SubTokensOptions.CanElement | (cr.GroupResults ? SubTokensOptions.CanAggregate : 0));
        }
开发者ID:JackWangCUMT,项目名称:extensions,代码行数:8,代码来源:UserChart.xaml.cs

示例10: UpdateTokenList

 private void UpdateTokenList(QueryToken queryToken)
 {
     if (queryToken == null)
         tokens = new List<QueryToken>();
     else
         tokens = queryToken.Follow(a => a.Parent).Reverse().ToList();
     UpdateCombo();
 }
开发者ID:rondoo,项目名称:framework,代码行数:8,代码来源:QueryTokenBuilder.xaml.cs

示例11: BagPropertyToken

        internal BagPropertyToken(QueryToken parent, PropertyInfo pi)
            : base(parent)
        {
            if (pi == null)
                throw new ArgumentNullException("pi");

            this.PropertyInfo = pi;
        }
开发者ID:rondoo,项目名称:framework,代码行数:8,代码来源:BagPropertyToken.cs

示例12: NavigationPropertyToken

        /// <summary>
        /// Create a new SegmentQueryToken given the name and parent and namedValues if any
        /// </summary>
        /// <param name="name">The name of the segment, the identifier.</param>
        /// <param name="parent">The parent segment, or null if this is the root segment.</param>
        /// <param name="namedValues">The named values in the key lookup for this segment.</param>
        public NavigationPropertyToken(string name, QueryToken parent, IEnumerable<NamedValue> namedValues)
        {
            // We allow an "empty" name segment so we can create one for the case of a service-document URL (which has no path)
            ExceptionUtils.CheckArgumentNotNull(name, "name");

            this.name = name;
            this.parent = parent;
            this.namedValues = namedValues == null ? null : new ReadOnlyEnumerable<NamedValue>(namedValues);
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:15,代码来源:NavigationPropertyToken.cs

示例13: BinaryOperatorQueryToken

        /// <summary>
        /// Create a new BinaryOperatorQueryToken given the operator, left and right query.
        /// </summary>
        /// <param name="operatorKind">The operator represented by this node.</param>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        public BinaryOperatorQueryToken(BinaryOperatorKind operatorKind, QueryToken left, QueryToken right)
        {
            ExceptionUtils.CheckArgumentNotNull(left, "left");
            ExceptionUtils.CheckArgumentNotNull(right, "right");

            this.operatorKind = operatorKind;
            this.left = left;
            this.right = right;
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:15,代码来源:BinaryOperatorQueryToken.cs

示例14: EntityPropertyToken

        internal EntityPropertyToken(QueryToken parent, PropertyInfo pi, PropertyRoute pr)
            : base(parent)
        {
            if (pi == null)
                throw new ArgumentNullException("pi");

            this.PropertyInfo = pi;
            this.PropertyRoute = pr;
        }
开发者ID:nuub666,项目名称:framework,代码行数:9,代码来源:EntityPropertyToken.cs

示例15: CollectionElementToken

        internal CollectionElementToken(QueryToken parent, CollectionElementType type)
            : base(parent)
        {
            elementType = parent.Type.ElementType();
            if (elementType == null)
                throw new InvalidOperationException("not a collection");

            this.CollectionElementType = type;
        }
开发者ID:rondoo,项目名称:framework,代码行数:9,代码来源:CollectionElementToken.cs


注:本文中的QueryToken类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。