Esempio n. 1
0
        public static Expression Build(QueryLinguist linguist, QueryPolicy policy, Expression expression, Expression provider)
        {
            var executor = Expression.Parameter(typeof(QueryExecutor), "executor");
            var builder  = new ExecutionBuilder(linguist, policy, executor);

            builder.variables.Add(executor);
            builder.initializers.Add(Expression.Call(Expression.Convert(provider, typeof(ICreateExecutor)), "CreateExecutor", null, null));
            var result = builder.Build(expression);

            return(result);
        }
Esempio n. 2
0
        private Expression BuildInner(Expression expression)
        {
            var eb = new ExecutionBuilder(this.linguist, this.policy, this.executor);

            eb.scope           = this.scope;
            eb.receivingMember = this.receivingMember;
            eb.nReaders        = this.nReaders;
            eb.nLookup         = this.nLookup;
            eb.variableMap     = this.variableMap;
            return(eb.Build(expression));
        }
Esempio n. 3
0
        private Expression BuildInner(Expression expression)
        {
            var eb = new ExecutionBuilder(linguist, policy, executor)
            {
                scope           = scope,
                receivingMember = receivingMember,
                nReaders        = nReaders,
                nLookup         = nLookup,
                variableMap     = variableMap
            };

            return(eb.Build(expression));
        }
Esempio n. 4
0
 /// <summary>
 /// Converts a query into an execution plan.
 /// The plan is an function that executes the query and builds the resulting objects.
 /// </summary>
 /// <param name="query">The <see cref="Expression"/> that encapsulates the query.</param>
 /// <param name="provider">An <see cref="Expression"/> the references the current <see cref="EntityProvider"/>.</param>
 public virtual Expression BuildExecutionPlan(Expression query, Expression provider)
 {
     return(ExecutionBuilder.Build(this.Translator.Linguist, this.Policy, query, provider));
 }