public object Execute(Expression expression) { var executionPlan = ExecutionPlanBuilder.BuildPlan( Expression.Constant(this), Translate(expression)); var lambda = Expression.Lambda(executionPlan); return(lambda.Compile().DynamicInvoke(null)); }
public Task <TResult> ExecuteAsync <TResult>(Expression expression, CancellationToken cancellationToken = default(CancellationToken)) { var executionPlan = ExecutionPlanBuilder.BuildAsyncPlan( Expression.Constant(this), Translate(expression), Expression.Constant(cancellationToken)); var lambda = Expression.Lambda(executionPlan); return((Task <TResult>)lambda.Compile().DynamicInvoke(null)); }
public object Execute(Expression expression) { var executionPlan = ExecutionPlanBuilder.BuildPlan( Expression.Constant(this), Translate(expression)); var lambda = Expression.Lambda(executionPlan); try { return(lambda.Compile().DynamicInvoke(null)); } catch (TargetInvocationException tie) { throw tie.InnerException; } }