public static Expression Build(QueryLinguist linguist, QueryPolicy policy, Expression expression, Expression provider)
        {
            ParameterExpression expression2;

            return(new ExecutionBuilder(linguist, policy, expression2 = Expression.Parameter(typeof(QueryExecutor), "executor"))
            {
                variables = { expression2 }, initializers = { Expression.Call((Expression)Expression.Convert(provider, typeof(ICreateExecutor)), "CreateExecutor", (Type[])null, (Expression[])null) }
            }.Build(expression));
        }
Exemplo n.º 2
0
        public override bool HasIncludedMembers(EntityExpression entity)
        {
            QueryPolicy policy = this.translator.Police.Policy;

            foreach (MemberInfo info in this.mapping.GetMappedMembers(entity.Entity))
            {
                if (policy.IsIncluded(info))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 3
0
 public QueryPolice(QueryPolicy policy, QueryTranslator translator)
 {
     this.policy     = policy;
     this.translator = translator;
 }
 private ExecutionBuilder(QueryLinguist linguist, QueryPolicy policy, Expression executor)
 {
     this.linguist = linguist;
     this.policy   = policy;
     this.executor = executor;
 }
Exemplo n.º 5
0
 private RelationshipIncluder(QueryMapper mapper)
 {
     this.mapper = mapper;
     this.policy = mapper.Translator.Police.Policy;
 }
 public static Expression Rewrite(QueryPolicy policy, QueryLanguage language, Expression expression)
 {
     return(new ClientJoinedProjectionRewriter(policy, language).Visit(expression));
 }
 private ClientJoinedProjectionRewriter(QueryPolicy policy, QueryLanguage language)
 {
     this.policy   = policy;
     this.language = language;
 }
Exemplo n.º 8
0
 public QueryTranslator(QueryLanguage language, QueryMapping mapping, QueryPolicy policy)
 {
     this.linguist = language.CreateLinguist(this);
     this.mapper   = mapping.CreateMapper(this);
     this.police   = policy.CreatePolice(this);
 }