Ejemplo n.º 1
0
        private Expression BuildInner(Expression expression)
        {
            var eb = new ExecutionBuilder(linguist, policy, executor);

            eb.scope           = scope;
            eb.receivingMember = receivingMember;
            eb.nReaders        = nReaders;
            eb.nLookup         = nLookup;
            eb.variableMap     = variableMap;
            return(eb.Build(expression));
        }
Ejemplo n.º 2
0
        public static Expression Build(QueryLinguist linguist, QueryPolicy policy, Expression expression, Expression provider)
        {
            ParameterExpression 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));
            Expression result = builder.Build(expression);

            return(result);
        }
Ejemplo n.º 3
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="projection"> </param>
 /// <param name="provider"> </param>
 /// <returns> </returns>
 public virtual Expression BuildExecutionPlan(Expression query, Expression provider)
 {
     return(ExecutionBuilder.Build(translator.Linguist, policy, query, provider));
 }