/// <summary> /// Evaluates the specified expression. /// </summary> /// <param name="expression">The expression to evaluate.</param> /// <returns>Value of the expression.</returns> public QueryValue Visit(LinqMinExpression expression) { return(this.EvaluateQueryMethodWithLambdaExpression <QueryScalarValue>( expression, c => c.Min(), (c, lambda) => c.Min(lambda))); }
/// <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(LinqMinExpression expression) { var source = this.ResolveTypes(expression.Source); var sourceType = ValidateSourceIsACollection(source); var lambda = expression.Lambda != null?this.ResolveLambdaTypes(expression.Lambda, sourceType) : null; var expressionType = lambda != null ? lambda.Body.ExpressionType : sourceType.ElementType; ExceptionUtilities.Assert(expressionType is QueryScalarType, "Min expression without predicate can only be applied on collections of scalars."); return(new LinqMinExpression(source, lambda, expressionType)); }
/// <summary> /// Visits a QueryExpression tree whose root node is the LinqMinExpression. /// </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(LinqMinExpression expression) { throw new TaupoNotSupportedException("Not supported"); }
/// <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(LinqMinExpression expression) { return(this.VisitQueryMethodWithLambdaExpression(expression, "Min")); }
/// <summary> /// Visits a QueryExpression tree whose root node is the LinqMinExpression. /// </summary> /// <param name="expression">The root node of the expression tree being visited.</param> /// <returns>Replaced expression.</returns> public virtual QueryExpression Visit(LinqMinExpression expression) { return(this.VisitQueryMethodWithLambdaExpression(expression, (s, l, t) => new LinqMinExpression(s, l, t))); }