public object Execute(Expression expression) { var executionPlan = QueryableExecutionBuilder.Build( Prepare(expression), Expression.Constant(this), _collection.Settings.SerializerRegistry); var efn = Expression.Lambda(executionPlan); return(efn.Compile().DynamicInvoke(null)); }
public Task <TResult> ExecuteAsync <TResult>(Expression expression, CancellationToken cancellationToken = default(CancellationToken)) { var executionPlan = QueryableExecutionBuilder.BuildAsync( Prepare(expression), Expression.Constant(this), Expression.Constant(cancellationToken), _collection.Settings.SerializerRegistry); var efn = Expression.Lambda(executionPlan); return((Task <TResult>)efn.Compile().DynamicInvoke(null)); }