예제 #1
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);
        }
예제 #2
0
 public QueryTranslator(QueryLanguage language, QueryMapping mapping, QueryPolicy policy)
 {
     linguist = language.CreateLinguist(this);
     mapper   = mapping.CreateMapper(this);
     police   = policy.CreatePolice(this);
 }
예제 #3
0
 private ExecutionBuilder(QueryLinguist linguist, QueryPolicy policy, Expression executor)
 {
     this.linguist = linguist;
     this.policy   = policy;
     this.executor = executor;
 }