public static Expression Build(QueryLinguist linguist, QueryPolicy policy, Expression expression, Expression provider) { var executor = Expression.Parameter(typeof(QueryExecutor), "executor"); var builder = new VfpExecutionBuilder(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); }
private VfpExecutionBuilder(QueryLinguist linguist, QueryPolicy policy, Expression executor) { this.linguist = linguist; this.policy = policy; this.executor = executor; }