コード例 #1
0
        /// <summary>
        /// Binds a unary operator token.
        /// </summary>
        /// <param name="unaryOperatorToken">The unary operator token to bind.</param>
        /// <returns>The bound unary operator token.</returns>
        internal QueryNode BindUnaryOperator(UnaryOperatorToken unaryOperatorToken)
        {
            ExceptionUtils.CheckArgumentNotNull(unaryOperatorToken, "unaryOperatorToken");

            SingleValueNode operand = this.GetOperandFromToken(unaryOperatorToken);

            IEdmTypeReference typeReference = UnaryOperatorBinder.PromoteOperandType(operand, unaryOperatorToken.OperatorKind);

            Debug.Assert(typeReference == null || typeReference.IsODataPrimitiveTypeKind(), "Only primitive types should be able to get here.");
            operand = MetadataBindingUtils.ConvertToTypeIfNeeded(operand, typeReference);

            return(new UnaryOperatorNode(unaryOperatorToken.OperatorKind, operand));
        }
コード例 #2
0
        /// <summary>
        /// Binds a unary operator token.
        /// </summary>
        /// <param name="unaryOperatorToken">The unary operator token to bind.</param>
        /// <returns>The bound unary operator token.</returns>
        protected virtual QueryNode BindUnaryOperator(UnaryOperatorToken unaryOperatorToken)
        {
            UnaryOperatorBinder unaryOperatorBinder = new UnaryOperatorBinder(this.Bind);

            return(unaryOperatorBinder.BindUnaryOperator(unaryOperatorToken));
        }
コード例 #3
0
ファイル: MetadataBinder.cs プロジェクト: larsenjo/odata.net
 /// <summary>
 /// Binds a unary operator token.
 /// </summary>
 /// <param name="unaryOperatorToken">The unary operator token to bind.</param>
 /// <returns>The bound unary operator token.</returns>
 protected virtual QueryNode BindUnaryOperator(UnaryOperatorToken unaryOperatorToken)
 {
     UnaryOperatorBinder unaryOperatorBinder = new UnaryOperatorBinder(this.Bind);
     return unaryOperatorBinder.BindUnaryOperator(unaryOperatorToken);
 }