CompileAndRun() public static method

public static CompileAndRun ( Expression expression ) : object
expression System.Linq.Expressions.Expression
return object
Esempio n. 1
0
		public static object Interpret(Expression expression)
		{
			var interpreter = new ExpressionInterpreter();

			var result = interpreter.Visit(expression);
			
			if (result == InterpretFailed)
			{
				result = ExpressionFastCompiler.CompileAndRun(expression);
			}

			return result;
		}
Esempio n. 2
0
        public static object Interpret(Expression expression)
        {
            var interpreter = new ExpressionInterpreter();

            try
            {
                var result = interpreter.Visit(expression);

                if (result == InterpretFailed)
                {
                    result = ExpressionFastCompiler.CompileAndRun(expression);
                }

                return(result);
            }
            catch (TargetInvocationException e)
            {
                throw e.InnerException;
            }
        }