예제 #1
0
        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));
        }
예제 #2
0
        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));
        }