/// <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(LinqExceptExpression expression) { CodeExpression outer = this.GenerateCode(expression.Outer); CodeExpression inner = this.GenerateCode(expression.Inner); return(outer.Call("Except", inner)); }
/// <summary> /// Evaluates the specified expression. /// </summary> /// <param name="expression">The expression to evaluate.</param> /// <returns>Value of the expression.</returns> public QueryValue Visit(LinqExceptExpression expression) { var outer = this.EvaluateCollection(expression.Outer); var inner = this.EvaluateCollection(expression.Inner); return(outer.Except(inner)); }
/// <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(LinqExceptExpression expression) { var outer = this.ResolveTypes(expression.Outer); var inner = this.ResolveTypes(expression.Inner); ExceptionUtilities.Assert(outer.ExpressionType.IsAssignableFrom(inner.ExpressionType), "Incompatible collection types for linq EXCEPT expression"); return(new LinqExceptExpression(outer, inner, outer.ExpressionType)); }
/// <summary> /// Replaces the given expression. /// </summary> /// <param name="expression">Expression to replace.</param> /// <returns>Replaced expression.</returns> public QueryExpression Visit(LinqExceptExpression expression) { QueryExpression outer = this.ReplaceExpression(expression.Outer); QueryExpression inner = this.ReplaceExpression(expression.Inner); if (this.HasChanged(expression.Outer, outer) || this.HasChanged(expression.Inner, inner)) { return(new LinqExceptExpression(outer, inner, expression.ExpressionType)); } return(expression); }
/// <summary> /// Visits a QueryExpression tree whose root node is the LinqExceptExpression. /// </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(LinqExceptExpression expression) { throw new TaupoNotSupportedException("Not supported"); }