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