Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public QueryPolice(QueryPolicy policy, QueryTranslator translator)
 {
     this.policy = policy;
     this.translator = translator;
 }
Exemplo n.º 4
0
 protected OExecutionBuilder(QueryLinguist linguist, QueryPolicy policy, OTypeBuilder typeBuilder, Expression executor)
     : base(linguist, policy, executor)
 {
     this.TypeBuilder = typeBuilder;
     _repoType = linguist.Translator.Mapper.Mapping.RepositoryType;
 }
Exemplo n.º 5
0
 public QueryTranslator(QueryLanguage language, QueryMapping mapping, QueryPolicy policy)
 {
     this.linguist = language.CreateLinguist(this);
     this.mapper = mapping.CreateMapper(this);
     this.police = policy.CreatePolice(this);
 }