/// <summary> /// Evaluates the specified expression. /// </summary> /// <param name="expression">The expression to evaluate.</param> /// <returns>Value of the expression.</returns> public virtual QueryValue Visit(QueryEqualToExpression expression) { // This for cases like ComplexType = null if (expression.Left.ExpressionType is QueryStructuralType) { QueryStructuralValue left, right; this.EvaluateBinaryArguments(expression, out left, out right); return(left.EqualTo(right)); } else if (expression.Left.ExpressionType is QueryReferenceType) { QueryReferenceValue left, right; this.EvaluateBinaryArguments(expression, out left, out right); return(left.EqualTo(right)); } else if (expression.Left.ExpressionType is QueryScalarType) { QueryScalarValue left, right; this.EvaluateBinaryArguments(expression, out left, out right); return(left.EqualTo(right)); } else { throw new TaupoNotSupportedException("Equality on type" + expression.Left.ExpressionType.ToString() + " is not supported"); } }
/// <summary> /// Visits a QueryExpression tree whose root node is the QueryEqualToExpression. /// </summary> /// <param name="expression">The root node of the expression tree being visited.</param> /// <returns>Uri query string representing the expression.</returns> public override string Visit(QueryEqualToExpression expression) { return this.VisitBinaryExpession(expression, "{0} eq {1}"); }
/// <summary> /// Replaces the given expression. /// </summary> /// <param name="expression">Expression to replace.</param> /// <returns>Replaced expression.</returns> public virtual QueryExpression Visit(QueryEqualToExpression expression) { return(this.VisitBinaryExpression(expression, CommonQueryBuilder.EqualTo)); }
/// <summary> /// Visits a QueryExpression tree whose root node is the QueryEqualToExpression. /// </summary> /// <param name="expression">The root node of the expression tree being visited.</param> /// <returns>Uri query string representing the expression.</returns> public virtual string Visit(QueryEqualToExpression expression) { throw new TaupoNotSupportedException("Not supported"); }
/// <summary> /// Resolves types for the specified expression. /// </summary> /// <param name="expression">The expression to resolve types for.</param> /// <returns>Expression with resolved types.</returns> public QueryExpression Visit(QueryEqualToExpression expression) { return(this.VisitBinaryExpressionWithBooleanResult(expression, CommonQueryBuilder.EqualTo)); }
/// <summary> /// Generates System.CodeDom.CodeExpression from the given expression. /// </summary> /// <param name="expression">Expression from which System.CodeDom.CodeExpression is generated.</param> /// <returns>Generated System.CodeDom.CodeExpression.</returns> public virtual CodeExpression Visit(QueryEqualToExpression expression) { return(this.VisitBinaryExpression(expression, CodeBinaryOperatorType.ValueEquality)); }
/// <summary> /// Visits a QueryExpression tree whose root node is the QueryEqualToExpression. /// </summary> /// <param name="expression">The root node of the expression tree being visited.</param> /// <returns>Uri query string representing the expression.</returns> public override string Visit(QueryEqualToExpression expression) { return(this.VisitBinaryExpession(expression, "{0} eq {1}")); }