/// <summary> /// Evaluates the specified expression. /// </summary> /// <param name="expression">The expression to evaluate.</param> /// <returns>Value of the expression.</returns> public QueryValue Visit(QueryIsNullExpression expression) { // Cannot be a collection ExceptionUtilities.Assert(!(expression.Argument.ExpressionType is QueryCollectionType), "IsNull expression cannot be a collection"); var argument = this.Evaluate(expression.Argument); return(argument.Type.EvaluationStrategy.BooleanType.CreateValue(argument.IsNull)); }
/// <summary> /// Replaces the given expression. /// </summary> /// <param name="expression">Expression to replace.</param> /// <returns>Replaced expression.</returns> public QueryExpression Visit(QueryIsNullExpression expression) { var argument = this.ReplaceExpression(expression.Argument); if (this.HasChanged(expression.Argument, argument)) { return(new QueryIsNullExpression(argument, expression.ExpressionType)); } else { return(expression); } }
/// <summary> /// Visits a QueryExpression tree whose root node is the QueryIsNullExpression. /// </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(QueryIsNullExpression expression) { string argument = this.Convert(expression.Argument); return string.Format(CultureInfo.InvariantCulture, "{0} eq null", argument); }
/// <summary> /// Visits a QueryExpression tree whose root node is the QueryIsNullExpression. /// </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(QueryIsNullExpression 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(QueryIsNullExpression expression) { var argument = this.ResolveTypes(expression.Argument); return(new QueryIsNullExpression(argument, this.EvaluationStrategy.BooleanType)); }
/// <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(QueryIsNullExpression expression) { var argument = this.GenerateCode(expression.Argument); return(Code.ValueEquals(argument, Code.Null())); }
/// <summary> /// Visits a QueryExpression tree whose root node is the QueryIsNullExpression. /// </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(QueryIsNullExpression expression) { string argument = this.Convert(expression.Argument); return(string.Format(CultureInfo.InvariantCulture, "{0} eq null", argument)); }