Inheritance: SqlExpressionVisitor
Example #1
0
 /// <summary>
 /// When overridden by a derived class, this method evaluates the expression
 /// within the provided context.
 /// </summary>
 /// <param name="context">The context for the evaluation of the expression, providing
 /// access to the system or to the execution context.</param>
 /// <remarks>
 /// <para>
 /// This method is only executed is <see cref="CanEvaluate"/> is <c>true</c>, and the
 /// override method can reduce this expression to a simpler form.
 /// </para>
 /// </remarks>
 /// <returns>
 /// Returns a new <seealso cref="SqlExpression"/> that is the result of the
 /// evaluation of this expression, within the context given.
 /// </returns>
 /// <exception cref="ExpressionEvaluateException">
 /// If any error occurred while evaluating the expression.
 /// </exception>
 public virtual SqlExpression Evaluate(EvaluateContext context)
 {
     var visitor = new ExpressionEvaluatorVisitor(context);
     return visitor.Visit(this);
 }
Example #2
0
        /// <summary>
        /// When overridden by a derived class, this method evaluates the expression
        /// within the provided context.
        /// </summary>
        /// <param name="context">The context for the evaluation of the expression, providing
        /// access to the system or to the execution context.</param>
        /// <remarks>
        /// <para>
        /// This method is only executed is <see cref="CanEvaluate"/> is <c>true</c>, and the
        /// override method can reduce this expression to a simpler form.
        /// </para>
        /// </remarks>
        /// <returns>
        /// Returns a new <seealso cref="SqlExpression"/> that is the result of the
        /// evaluation of this expression, within the context given.
        /// </returns>
        /// <exception cref="ExpressionEvaluateException">
        /// If any error occurred while evaluating the expression.
        /// </exception>
        public virtual SqlExpression Evaluate(EvaluateContext context)
        {
            var visitor = new ExpressionEvaluatorVisitor(context);

            return(visitor.Visit(this));
        }