コード例 #1
0
 /// <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");
     }
 }
コード例 #2
0
 /// <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}");
 }
コード例 #3
0
 /// <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));
 }
コード例 #4
0
 /// <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");
 }
コード例 #5
0
 /// <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));
 }
コード例 #6
0
 /// <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));
 }
コード例 #7
0
 /// <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}"));
 }