public static new Expression Build(QueryLinguist linguist, QueryPolicy policy, Expression expression, Expression provider) { var executor = Expression.Parameter(typeof(QueryExecutor), "executor"); var builder = new OExecutionBuilder(linguist, policy, new OTypeBuilder(linguist), executor); builder.Variables.Add(executor); builder.Initializers.Add( Expression.Convert( Expression.Call(Expression.Convert(provider, typeof(ICreateExecutor)), "CreateExecutor", null, null), typeof(QueryExecutor))); var result = builder.Build(expression); return result; }
public DataProvider(IRepository repository, QueryLanguage language, QueryMapping mapping, QueryPolicy policy) { if (language == null) throw new InvalidOperationException("Language not specified"); if (mapping == null) throw new InvalidOperationException("Mapping not specified"); if (policy == null) throw new InvalidOperationException("Policy not specified"); this._language = language; this._mapping = mapping; this._policy = policy; this.Repository = repository; }
public QueryPolice(QueryPolicy policy, QueryTranslator translator) { this.policy = policy; this.translator = translator; }
protected OExecutionBuilder(QueryLinguist linguist, QueryPolicy policy, OTypeBuilder typeBuilder, Expression executor) : base(linguist, policy, executor) { this.TypeBuilder = typeBuilder; _repoType = linguist.Translator.Mapper.Mapping.RepositoryType; }
public QueryTranslator(QueryLanguage language, QueryMapping mapping, QueryPolicy policy) { this.linguist = language.CreateLinguist(this); this.mapper = mapping.CreateMapper(this); this.police = policy.CreatePolice(this); }